/**
 * Image Source Switcher - Frontend Styles
 * Floating panel for image source switching
 */

/* Container */
.iss-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99998;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    max-width: 280px;
    transition: all 0.3s ease;
}

.iss-switcher-inner {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Header */
.iss-switcher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    cursor: pointer;
}

.iss-switcher-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.iss-switcher-title::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
    animation: iss-pulse 2s infinite;
}

@keyframes iss-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.iss-switcher-toggle-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: transform 0.2s;
    opacity: 0.8;
}

.iss-switcher-toggle-btn:hover {
    opacity: 1;
}

.iss-switcher-toggle-btn.collapsed svg {
    transform: rotate(180deg);
}

.iss-switcher-toggle-btn svg {
    transition: transform 0.2s;
}

/* Body */
.iss-switcher-body {
    padding: 8px;
    animation: iss-slide-down 0.3s ease;
}

@keyframes iss-slide-down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Options */
.iss-switcher-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Source buttons */
.iss-source-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fafafa;
    color: #555;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.iss-source-btn:hover {
    background: #f0f0ff;
    border-color: #667eea;
    color: #333;
    transform: translateX(2px);
}

.iss-source-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.iss-source-btn.active .iss-source-icon svg {
    stroke: #fff;
}

.iss-source-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.iss-source-icon svg {
    stroke: #888;
    transition: stroke 0.2s;
}

.iss-source-btn:hover .iss-source-icon svg {
    stroke: #667eea;
}

/* Status text */
.iss-switcher-status {
    margin-top: 6px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    min-height: 18px;
}

.iss-status-text {
    font-size: 11px;
    color: #888;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f5f5f5;
    display: inline-block;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .iss-switcher {
        bottom: 12px;
        right: 12px;
        max-width: 240px;
    }

    .iss-switcher-header {
        padding: 8px 12px;
    }

    .iss-switcher-title {
        font-size: 12px;
    }

    .iss-source-btn {
        padding: 7px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .iss-switcher {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .iss-switcher-inner {
        background: #1e1e2e;
        border-color: #333;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    }

    .iss-switcher-header {
        background: linear-gradient(135deg, #4c51bf 0%, #553c9a 100%);
    }

    .iss-source-btn {
        background: #2a2a3e;
        border-color: #3a3a4e;
        color: #ccc;
    }

    .iss-source-btn:hover {
        background: #33334a;
        border-color: #667eea;
        color: #fff;
    }

    .iss-source-icon svg {
        stroke: #888;
    }

    .iss-source-btn:hover .iss-source-icon svg {
        stroke: #818cf8;
    }

    .iss-status-text {
        color: #aaa;
        background: #2a2a3e;
    }
}
