/* Modern, Clean Design System */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #06b6d4;
    --info-light: #cffafe;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--gray-900);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--gray-600);
    font-size: 16px;
}

.nav-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--primary-light);
}

/* Card */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.help-text {
    color: var(--gray-600);
    font-size: 14px;
}

/* Upload Zone */
.upload-zone {
    border: 3px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--gray-50);
}

.upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 13px;
    color: var(--gray-500);
    font-family: 'Courier New', monospace;
}

/* File Info Card */
.file-info-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 2px solid var(--gray-200);
    margin: 20px 0;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 16px;
}

.file-icon-large {
    font-size: 40px;
}

.file-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.file-size {
    font-size: 14px;
    color: var(--gray-600);
}

.btn-remove {
    background: var(--danger);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Week Info */
.week-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
    padding: 20px;
    background: var(--info-light);
    border-radius: var(--radius);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.info-value.status {
    color: var(--success);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-large {
    width: 100%;
    padding: 18px 32px;
    font-size: 18px;
    margin-top: 20px;
}

.btn-icon {
    font-size: 20px;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-card {
    background: white;
    padding: 48px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.spinner {
    width: 64px;
    height: 64px;
    border: 6px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

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

.loading-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 16px;
}

.status-updates {
    max-width: 500px;
    text-align: left;
    margin-top: 24px;
}

.status-update {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    animation: slideIn 0.3s ease-out;
}

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

.status-update-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.status-update-text {
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.5;
}

.status-update.success .status-update-icon {
    color: var(--success);
}

.status-update.info .status-update-icon {
    color: var(--info);
}

.status-update.warning .status-update-icon {
    color: var(--warning);
}

/* Error Card */
.error-card {
    background: var(--danger-light);
    border: 2px solid var(--danger);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.error-icon {
    font-size: 32px;
}

.error-content h3 {
    color: var(--danger);
    margin-bottom: 8px;
}

.error-content p {
    color: var(--gray-700);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 40px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
}

.stat-new {
    border-left: 4px solid var(--success);
}

.stat-new .stat-value {
    color: var(--success);
}

.stat-modified {
    border-left: 4px solid var(--warning);
}

.stat-modified .stat-value {
    color: var(--warning);
}

.stat-removed {
    border-left: 4px solid var(--danger);
}

.stat-removed .stat-value {
    color: var(--danger);
}

.stat-unchanged {
    border-left: 4px solid var(--gray-400);
}

.stat-unchanged .stat-value {
    color: var(--gray-600);
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.download-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* EID Section */
.eid-count {
    background: var(--primary-light);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

#eid-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.eid-group {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s;
}

.eid-group:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.eid-header {
    background: var(--gray-50);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.eid-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.eid-stats {
    display: flex;
    gap: 16px;
}

.eid-stat {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
}

.eid-stat.new {
    background: var(--success-light);
    color: var(--success);
}

.eid-stat.modified {
    background: var(--warning-light);
    color: var(--warning);
}

.eid-stat.removed {
    background: var(--danger-light);
    color: var(--danger);
}

.eid-content {
    padding: 20px;
    display: none;
}

.eid-content.expanded {
    display: block;
}

.change-section {
    margin-bottom: 24px;
}

.change-section-header {
    background: var(--gray-100);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.change-section-header:hover {
    background: var(--gray-200);
}

.change-details {
    display: none;
    padding: 16px;
}

.change-details.expanded {
    display: block;
}

.change-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.change-table th {
    background: var(--gray-100);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--gray-300);
}

.change-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.change-table tr:hover {
    background: var(--gray-50);
}

.delta-positive {
    color: var(--success);
    font-weight: 600;
}

.delta-negative {
    color: var(--danger);
    font-weight: 600;
}

/* BSD Change Indicators */
.bsd-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    margin-left: 8px;
}

.bsd-badge.bsd-pushed {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.bsd-badge.bsd-pulled {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #17a2b8;
}

.field-changed {
    background: var(--warning-light);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px;
    color: white;
    font-size: 14px;
}

/* How It Works Section */
.how-it-works {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.how-it-works .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.how-it-works .section-header h2 {
    color: white;
}

.btn-collapse {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-collapse:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.how-it-works-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, opacity 0.3s;
    opacity: 1;
}

.how-it-works-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
}

.workflow-step {
    display: flex;
    gap: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 24px;
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: white;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
}

.step-content h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: white;
}

.step-content p {
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
}

.step-content ul {
    margin-top: 12px;
    padding-left: 20px;
}

.step-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.step-content ul ul {
    margin-top: 8px;
}

.tooltip {
    border-bottom: 2px dotted rgba(255, 255, 255, 0.6);
    cursor: help;
    position: relative;
}

.tooltip:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 8px;
}

.glossary {
    background: rgba(255, 255, 255, 0.1);
    padding: 24px;
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.glossary h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: white;
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.glossary-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: var(--radius-sm);
}

.glossary-item strong {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
    color: white;
}

.glossary-item p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* MaitreD Results */
.maitred-results {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.maitred-results .section-header h2 {
    color: white;
}

.maitred-summary {
    background: rgba(255, 255, 255, 0.1);
    padding: 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.maitred-summary h3 {
    color: white;
    margin-bottom: 16px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.summary-value.warning {
    color: var(--warning);
}

.maitred-downloads {
    background: rgba(255, 255, 255, 0.1);
    padding: 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.maitred-downloads h3 {
    color: white;
    margin-bottom: 16px;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.download-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.download-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.download-eid {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

.download-count {
    font-size: 14px;
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
}

.btn-download {
    width: 100%;
    margin-bottom: 12px;
}

.download-expires {
    font-size: 12px;
    color: var(--gray-500);
    text-align: center;
}

.validation-errors {
    background: rgba(255, 255, 255, 0.1);
    padding: 24px;
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.validation-errors h3 {
    color: var(--warning);
    margin-bottom: 16px;
}

.error-list {
    max-height: 400px;
    overflow-y: auto;
}

.error-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    color: var(--gray-900);
}

.error-item strong {
    display: block;
    margin-bottom: 8px;
    color: var(--danger);
}

.error-item ul {
    margin: 8px 0 0 20px;
}

.error-item li {
    margin-bottom: 4px;
    color: var(--gray-700);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-bar {
        flex-direction: column;
    }
    
    .download-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .download-buttons button {
        width: 100%;
    }
}


/* Signed/Unsigned Badges */
.badge-signed,
.badge-unsigned {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin-right: 8px;
}

.badge-signed {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.badge-unsigned {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning);
}

/* Composite Key Warning */
.composite-key-warning {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: 6px;
    font-size: 12px;
    color: var(--warning);
}

.composite-key-warning::before {
    content: '⚠️';
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
    align-items: center;
    z-index: 9998;
}

.loading-indicator::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

.loading-message {
    font-size: 1rem;
    font-weight: 500;
    color: #495057;
}

/* Warnings Container */
.warnings-container {
    margin-top: 1rem;
}

.warnings-container .alert {
    margin-bottom: 0.5rem;
}

.warnings-container .alert:last-child {
    margin-bottom: 0;
}

/* Success/Error Notifications */
.alert.position-fixed {
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* EID Selection Controls */
.eid-selection-controls {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.selection-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.selection-buttons {
    display: flex;
    gap: 12px;
}

.selection-counter {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    padding: 8px 16px;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-300);
}

.counter-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* EID Checkbox Styling */
.eid-checkbox-container {
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.eid-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.eid-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.eid-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.eid-header-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 16px;
}

.eid-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

/* Tracked Badge */
/* CID Badge */
.cid-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: var(--success-light);
    color: var(--success);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--success);
    margin-left: 8px;
}

/* Grouping Badge */
.grouping-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: var(--warning-light);
    color: var(--warning);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--warning);
    margin-left: 8px;
}

/* Section Headers */
.section-header {
    margin-top: 32px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-300);
}

.section-header h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.section-description {
    margin: 0;
    font-size: 14px;
    color: var(--gray-600);
}

.tracked-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: var(--info-light);
    color: var(--info);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--info);
}

/* Selected EID Visual Indicator */
.eid-group[data-selected="true"] {
    border-left: 4px solid var(--primary);
    background: var(--primary-light);
}

/* Button Styles */
.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-outline-primary {
    color: var(--primary);
    border: 1px solid var(--primary);
    background: white;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-outline-secondary {
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
    background: white;
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* Responsive Design */
@media (max-width: 768px) {
    .selection-controls-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .selection-buttons {
        width: 100%;
    }
    
    .selection-buttons button {
        flex: 1;
    }
    
    .selection-counter {
        text-align: center;
    }
}

/* Ticket Text Styles */
.download-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-copy-ticket {
    width: 100%;
    padding: 10px 16px;
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-copy-ticket:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-copy-ticket.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.ticket-preview {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
}

.ticket-preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
    line-height: 1.4;
}

.ticket-preview-description {
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Ticket Text Modal */
.ticket-text-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--gray-400);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-instructions {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.ticket-text-area {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    background: var(--gray-50);
    color: var(--gray-900);
}

.ticket-text-area:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid var(--gray-200);
}

.modal-footer .btn-secondary,
.modal-footer .btn-primary {
    padding: 10px 20px;
}

/* Warning Banner */
.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
}

#selection-warning {
    margin-top: 12px;
}

#selection-warning .alert {
    margin-bottom: 0;
}

.warning-icon {
    font-size: 20px;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .ticket-text-modal {
        padding: 10px;
    }
    
    .modal-content {
        max-height: 90vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    .ticket-text-area {
        min-height: 200px;
        font-size: 12px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
}
