/* ============================================
   Export Tab - Modern UI Styles
   ============================================ */

/* ============================================
   CSS Variables
   ============================================ */

.export-page {
    --export-primary: #1a56db;
    --export-primary-light: #eff6ff;
    --export-primary-hover: #1648b5;
    --export-success: #059669;
    --export-success-light: #ecfdf5;
    --export-warning: #d97706;
    --export-warning-light: #fffbeb;
    --export-danger: #dc2626;
    --export-surface: #ffffff;
    --export-surface-alt: #f8fafc;
    --export-border: #e2e8f0;
    --export-border-light: #f1f5f9;
    --export-text: #1e293b;
    --export-text-muted: #64748b;
    --export-text-light: #94a3b8;
    --export-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --export-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --export-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --export-radius: 8px;
    --export-radius-lg: 12px;
    --export-transition: all 0.2s ease;
}

/* Dark mode */
[data-theme="dark"] .export-page {
    --export-primary: #3b82f6;
    --export-primary-light: #1e3a5f;
    --export-primary-hover: #60a5fa;
    --export-success-light: #064e3b;
    --export-warning-light: #78350f;
    --export-surface: #1e293b;
    --export-surface-alt: #0f172a;
    --export-border: #334155;
    --export-border-light: #1e293b;
    --export-text: #f1f5f9;
    --export-text-muted: #94a3b8;
    --export-text-light: #64748b;
}

/* ============================================
   Page Layout
   ============================================ */

.export-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ============================================
   Section Styles
   ============================================ */

.export-section {
    background: var(--export-surface);
    border: 1px solid var(--export-border);
    border-radius: var(--export-radius-lg);
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--export-border-light);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.section-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--export-primary-light);
    border-radius: var(--export-radius);
    color: var(--export-primary);
}

.section-icon svg {
    width: 20px;
    height: 20px;
}

.section-title h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--export-text);
    margin: 0;
}

.section-subtitle {
    font-size: 13px;
    color: var(--export-text-muted);
    margin: 2px 0 0 0;
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--export-surface-alt);
    border-radius: 50%;
    margin-bottom: 16px;
    color: var(--export-text-light);
}

.empty-state-icon svg {
    width: 32px;
    height: 32px;
}

.empty-state h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--export-text);
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 14px;
    color: var(--export-text-muted);
    margin: 0 0 20px 0;
    max-width: 300px;
}

/* ============================================
   Candidate Cards
   ============================================ */

.candidate-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    padding: 20px 24px;
}

.candidate-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--export-surface-alt);
    border: 1px solid var(--export-border-light);
    border-radius: var(--export-radius);
    transition: var(--export-transition);
}

.candidate-card:hover {
    border-color: var(--export-border);
    box-shadow: var(--export-shadow-sm);
}

.candidate-avatar {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid;
    flex-shrink: 0;
}

.candidate-info {
    flex: 1;
    min-width: 0;
}

.candidate-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--export-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.candidate-profile {
    font-size: 12px;
    color: var(--export-text-muted);
    margin: 2px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: var(--export-success);
    background: var(--export-success-light);
    padding: 2px 6px;
    border-radius: 4px;
}

.candidate-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.experience-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: var(--export-text-muted);
    background: var(--export-surface);
    border: 1px solid var(--export-border-light);
    padding: 2px 6px;
    border-radius: 4px;
}

.candidate-card-add {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    border-style: dashed;
    color: var(--export-text-muted);
}

.candidate-card-add:hover {
    color: var(--export-primary);
    border-color: var(--export-primary);
    background: var(--export-primary-light);
}

.add-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed currentColor;
    border-radius: 50%;
}

.add-icon svg {
    width: 16px;
    height: 16px;
}

.candidate-card-add span {
    font-size: 13px;
    font-weight: 500;
}

/* ============================================
   Buttons
   ============================================ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--export-primary);
    color: white;
    border: none;
    border-radius: var(--export-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--export-transition);
}

.btn-primary:hover:not(:disabled) {
    background: var(--export-primary-hover);
}

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

.btn-primary svg {
    width: 18px;
    height: 18px;
}

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    color: var(--export-text-muted);
    border: none;
    border-radius: var(--export-radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--export-transition);
}

.btn-text:hover {
    color: var(--export-danger);
    background: rgba(220, 38, 38, 0.1);
}

.btn-text svg {
    width: 16px;
    height: 16px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--export-radius);
    color: var(--export-text-light);
    cursor: pointer;
    transition: var(--export-transition);
}

.btn-icon:hover {
    background: var(--export-surface);
    color: var(--export-danger);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Export Options Section
   ============================================ */

.export-options-section.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.export-formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    padding: 20px 24px;
}

.format-card {
    background: var(--export-surface-alt);
    border: 2px solid var(--export-border-light);
    border-radius: var(--export-radius-lg);
    padding: 20px;
    transition: var(--export-transition);
}

.format-card:hover {
    border-color: var(--export-border);
}

.format-card.selected {
    border-color: var(--export-primary);
    background: var(--export-primary-light);
}

.format-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.format-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--export-radius);
    flex-shrink: 0;
}

.format-icon svg {
    width: 26px;
    height: 26px;
}

.format-icon-word {
    background: linear-gradient(135deg, #2b579a 0%, #185abd 100%);
    color: white;
}

.format-icon-eu {
    background: linear-gradient(135deg, #003399 0%, #004494 100%);
    color: #ffcc00;
}

.format-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--export-text);
    margin: 0 0 4px 0;
}

.format-info p {
    font-size: 13px;
    color: var(--export-text-muted);
    margin: 0;
    line-height: 1.4;
}

/* Template Options */
.template-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.template-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--export-surface);
    border: 1px solid var(--export-border-light);
    border-radius: var(--export-radius);
    cursor: pointer;
    transition: var(--export-transition);
}

.template-option:hover {
    border-color: var(--export-border);
}

.template-option.selected {
    border-color: var(--export-primary);
    background: white;
}

.template-option input {
    display: none;
}

.template-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--export-border);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: var(--export-transition);
}

.template-option.selected .template-radio {
    border-color: var(--export-primary);
}

.template-option.selected .template-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--export-primary);
    border-radius: 50%;
}

.template-info {
    flex: 1;
}

.template-info strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--export-text);
}

.template-info span {
    font-size: 12px;
    color: var(--export-text-muted);
}

/* Export Button */
.btn-export {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--export-primary);
    color: white;
    border: none;
    border-radius: var(--export-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--export-transition);
}

.btn-export:hover:not(:disabled) {
    background: var(--export-primary-hover);
}

.btn-export:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-export svg {
    width: 18px;
    height: 18px;
}

/* EU Format Buttons */
.eu-format-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.btn-eu-format {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 12px;
    background: var(--export-surface);
    border: 1px solid var(--export-border-light);
    border-radius: var(--export-radius);
    cursor: pointer;
    transition: var(--export-transition);
}

.btn-eu-format:hover:not(:disabled) {
    border-color: var(--export-primary);
    background: var(--export-primary-light);
}

.btn-eu-format:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.format-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--export-text);
}

.format-desc {
    font-size: 11px;
    color: var(--export-text-muted);
}

.eu-format-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--export-text-muted);
    background: var(--export-surface);
    padding: 10px 12px;
    border-radius: var(--export-radius);
}

.eu-format-note svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Language Selector */
.language-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--export-border-light);
    background: var(--export-surface-alt);
}

.language-selector label {
    font-size: 13px;
    font-weight: 500;
    color: var(--export-text-muted);
}

.language-selector select {
    padding: 8px 12px;
    background: var(--export-surface);
    border: 1px solid var(--export-border);
    border-radius: var(--export-radius);
    font-size: 13px;
    color: var(--export-text);
    cursor: pointer;
}

/* ============================================
   Guidebook Section
   ============================================ */

.export-guidebook-section {
    overflow: hidden;
}

.guidebook-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--export-surface);
    border: none;
    cursor: pointer;
    text-align: left;
    transition: var(--export-transition);
}

.guidebook-toggle:hover {
    background: var(--export-surface-alt);
}

.toggle-chevron {
    width: 20px;
    height: 20px;
    color: var(--export-text-muted);
    transition: transform 0.3s ease;
}

.guidebook-toggle.expanded .toggle-chevron {
    transform: rotate(180deg);
}

.guidebook-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.guidebook-content.expanded {
    max-height: 2000px;
}

/* Guidebook Tabs */
.guidebook-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    background: var(--export-surface-alt);
    border-top: 1px solid var(--export-border-light);
    border-bottom: 1px solid var(--export-border-light);
}

.guidebook-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: var(--export-radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--export-text-muted);
    cursor: pointer;
    transition: var(--export-transition);
}

.guidebook-tab:hover {
    background: var(--export-surface);
    color: var(--export-text);
}

.guidebook-tab.active {
    background: var(--export-primary);
    color: white;
}

/* Guidebook Panels */
.guidebook-panels {
    padding: 24px;
}

.guidebook-panel {
    display: none;
}

.guidebook-panel.active {
    display: block;
}

.guidebook-intro {
    margin-bottom: 20px;
}

.guidebook-intro p {
    font-size: 14px;
    color: var(--export-text-muted);
    line-height: 1.6;
    margin: 0;
}

.guidebook-panel h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--export-text);
    margin: 24px 0 8px 0;
}

.guidebook-panel h4:first-of-type {
    margin-top: 0;
}

.guidebook-panel > p {
    font-size: 13px;
    color: var(--export-text-muted);
    margin: 0 0 12px 0;
    line-height: 1.5;
}

/* Code Blocks */
.code-block {
    background: #1e293b;
    border-radius: var(--export-radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.code-block-large {
    max-height: 400px;
    overflow-y: auto;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-header span {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
}

.btn-copy {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    transition: var(--export-transition);
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-copy.copied {
    background: var(--export-success);
    color: white;
}

.code-block pre {
    margin: 0;
    padding: 14px;
    overflow-x: auto;
}

.code-block code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #e2e8f0;
}

.code-block .tag { color: #f472b6; }
.code-block .var { color: #7dd3fc; }
.code-block .keyword { color: #c084fc; }
.code-block .comment { color: #64748b; }
.code-block .muted { color: #64748b; font-style: italic; }

/* Fields Table */
.fields-table {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--export-border-light);
    border: 1px solid var(--export-border-light);
    border-radius: var(--export-radius);
    overflow: hidden;
}

.field-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    background: var(--export-surface);
}

.field-row code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: var(--export-primary);
    background: var(--export-primary-light);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.field-row span {
    font-size: 13px;
    color: var(--export-text-muted);
}

/* Tip Box */
.tip-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--export-primary-light);
    border: 1px solid rgba(26, 86, 219, 0.2);
    border-radius: var(--export-radius);
    margin-top: 16px;
}

.tip-box svg {
    width: 18px;
    height: 18px;
    color: var(--export-primary);
    flex-shrink: 0;
    margin-top: 1px;
}

.tip-box strong {
    color: var(--export-primary);
}

.tip-box div {
    font-size: 13px;
    color: var(--export-text);
    line-height: 1.5;
}

.tip-box-success {
    background: var(--export-success-light);
    border-color: rgba(5, 150, 105, 0.2);
}

.tip-box-success svg,
.tip-box-success strong {
    color: var(--export-success);
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10000;
}

.toast {
    padding: 12px 20px;
    background: var(--export-text);
    color: white;
    border-radius: var(--export-radius);
    font-size: 14px;
    box-shadow: var(--export-shadow-md);
    animation: toast-in 0.3s ease;
}

.toast-success {
    background: var(--export-success);
}

.toast-error {
    background: var(--export-danger);
}

.toast-warning {
    background: var(--export-warning);
}

.toast-fade-out {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 640px) {
    .export-page {
        gap: 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .candidate-cards {
        grid-template-columns: 1fr;
    }

    .export-formats-grid {
        grid-template-columns: 1fr;
    }

    .guidebook-tabs {
        flex-wrap: wrap;
    }

    .language-selector {
        flex-direction: column;
        align-items: flex-start;
    }

    .language-selector select {
        width: 100%;
    }
}
