.theme-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.theme-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.theme-panel {
    background: var(--bg-card, rgba(255, 255, 255, 0.98));
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg, 0 20px 40px rgba(0, 0, 0, 0.15));
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.theme-panel-overlay.active .theme-panel {
    transform: translateY(0);
}

.theme-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.theme-panel-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.theme-panel-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #4a4a4a);
    transition: all 0.2s;
}

.theme-panel-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary, #1a1a1a);
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.theme-option {
    padding: 1.25rem;
    border-radius: 16px;
    border: 2px solid transparent;
    background: rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.theme-option:hover {
    border-color: var(--border-hover, #4da6ff);
    background: rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.theme-option.active {
    border-color: var(--accent-primary, #0078e7);
    background: rgba(0, 120, 231, 0.08);
}

.theme-option-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.theme-option-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.theme-option-check {
    display: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary, #0078e7);
    color: white;
    align-items: center;
    justify-content: center;
    margin: 0.5rem auto 0;
    font-size: 0.7rem;
}

.theme-option.active .theme-option-check {
    display: flex;
}

.upload-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.upload-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.upload-modal {
    background: var(--bg-card, rgba(255, 255, 255, 0.98));
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg, 0 20px 40px rgba(0, 0, 0, 0.15));
    max-width: 500px;
    width: 90%;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.upload-modal-overlay.active .upload-modal {
    transform: translateY(0);
}

.upload-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.upload-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.upload-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #4a4a4a);
    transition: all 0.2s;
}

.upload-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.upload-zone {
    border: 2px dashed var(--border-color, rgba(0, 0, 0, 0.15));
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-primary, #0078e7);
    background: rgba(0, 120, 231, 0.05);
}

.upload-zone-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 120, 231, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: var(--accent-primary, #0078e7);
}

.upload-zone-text {
    font-size: 1rem;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 0.5rem;
}

.upload-zone-hint {
    font-size: 0.85rem;
    color: var(--text-muted, #888);
}

.upload-zone-input {
    display: none;
}

.upload-file-info {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.upload-file-info.visible {
    display: flex;
}

.upload-file-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(0, 120, 231, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary, #0078e7);
    flex-shrink: 0;
}

.upload-file-name {
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
    font-size: 0.9rem;
}

.upload-file-size {
    font-size: 0.8rem;
    color: var(--text-muted, #888);
}

.upload-actions {
    display: flex;
    gap: 1rem;
}

.upload-btn {
    flex: 1;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-md, 20px);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.upload-btn-primary {
    background: var(--accent-primary, #0078e7);
    color: white;
}

.upload-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.upload-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.upload-btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary, #4a4a4a);
}

.upload-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card, rgba(255, 255, 255, 0.98));
    border-radius: 16px;
    box-shadow: var(--shadow-lg, 0 20px 40px rgba(0, 0, 0, 0.15));
    padding: 0.5rem;
    min-width: 200px;
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
}

.export-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.export-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary, #4a4a4a);
    transition: all 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.export-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary, #1a1a1a);
}

.export-dropdown-item svg {
    flex-shrink: 0;
    color: var(--text-muted, #888);
}

.export-dropdown-separator {
    height: 1px;
    background: var(--border-color, rgba(0, 0, 0, 0.08));
    margin: 0.35rem 0.5rem;
}

.export-dropdown-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 1rem 0.25rem;
}

.chart-export-btn {
    background: none;
    border: none;
    color: var(--text-muted, #888);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-export-btn:hover {
    color: var(--accent-primary, #0078e7);
    background: rgba(0, 120, 231, 0.1);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-primary, #0078e7);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
}

.loading-subtext {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 768px) {
    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .theme-panel {
        padding: 2rem;
        border-radius: 24px;
    }

    .upload-modal {
        padding: 2rem;
        border-radius: 24px;
    }

    .upload-zone {
        padding: 2rem 1rem;
    }

    .export-dropdown-menu {
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .theme-grid {
        grid-template-columns: 1fr;
    }

    .upload-actions {
        flex-direction: column;
    }
}
