/* ==========================================================================
   Design Tokens & Variables
   ========================================================================== */
   :root {
    /* Color Palette */
    --color-bg-base: #0a0e1a;
    --color-surface: #111827;
    --color-card-bg: rgba(17, 24, 39, 0.8);
    --color-card-border: rgba(255, 255, 255, 0.08);
    
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-light: rgba(99, 102, 241, 0.15);
    
    --color-accent: #f59e0b;
    --color-accent-light: rgba(245, 158, 11, 0.15);
    
    --color-success: #10b981;
    --color-success-bg: rgba(16, 185, 129, 0.15);
    
    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.15);
    
    --color-error: #f97316;
    --color-error-bg: rgba(249, 115, 22, 0.15);
    
    --color-critical: #ef4444;
    --color-critical-bg: rgba(239, 68, 68, 0.15);
    
    --color-text-main: #f1f5f9;
    --color-text-muted: #94a3b8;
    
    /* Gradients */
    --gradient-header: linear-gradient(135deg, #0a0e1a 0%, #1e1b4b 100%);
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-primary-hover: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    
    /* Layout */
    --container-width: 1400px;
    --border-radius-sm: 6px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--color-bg-base);
    color: var(--color-text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Scrollbar for dark theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-surface);
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: var(--border-radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h2 {
    font-size: 1.25rem;
    color: var(--color-text-main);
}

h3 {
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

p {
    margin-bottom: 1rem;
}

.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }
.text-critical { color: var(--color-critical); }
.text-accent { color: var(--color-accent); }

/* ==========================================================================
   Components
   ========================================================================== */

/* Glassmorphism Panel */
.glass-panel {
    background: var(--color-card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-card-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

/* Header */
.app-header {
    background: var(--gradient-header);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hotel-icon {
    width: 28px;
    height: 28px;
    color: var(--color-primary);
}

.subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

/* Buttons */
button {
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover:not(:disabled) {
    background: var(--gradient-primary-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #334155;
    box-shadow: none;
    color: var(--color-text-muted);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-main);
    border: 1px solid var(--color-card-border);
    padding: 0.5rem 1rem;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--color-text-muted);
}

.icon-btn {
    background: transparent;
    color: var(--color-text-muted);
    padding: 0.5rem;
    border-radius: var(--border-radius-full);
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--color-text-main);
}

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

/* Upload Section */
.upload-section {
    margin-top: 2rem;
    padding: 2rem;
}

.drag-zones-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.drag-zone {
    flex: 1;
    min-width: 250px;
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
    background: rgba(255,255,255,0.02);
}

.drag-zone:hover, .drag-zone.active {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    box-shadow: var(--shadow-glow);
}

.drag-zone.loaded {
    border-color: var(--color-success);
    background: var(--color-success-bg);
}

.dz-icon {
    margin-bottom: 1rem;
    color: var(--color-text-muted);
}

.dz-icon svg {
    width: 48px;
    height: 48px;
}

.drag-zone:hover .dz-icon {
    color: var(--color-primary);
}

.drag-zone.loaded .dz-icon {
    color: var(--color-success);
}

.drag-zone h3 {
    margin-bottom: 0.5rem;
    color: var(--color-text-main);
}

.drag-zone p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.drag-zone p span {
    color: var(--color-primary);
    text-decoration: underline;
}

.upload-options {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.dark-input, .search-box input {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--color-card-border);
    color: var(--color-text-main);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast);
}

.dark-input:focus, .search-box input:focus {
    border-color: var(--color-primary);
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 200px;
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0.7;
}

.stat-title {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

/* Filters Section */
.filters-section {
    margin-top: 2rem;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filters-left {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-full);
}

.filter-btn:hover {
    background: rgba(255,255,255,0.05);
}

.filter-btn.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
}

.search-box input {
    width: 100%;
    padding-left: 2.5rem;
}

/* Results Table */
.results-section {
    margin-top: 2rem;
    padding: 0;
    overflow: hidden;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

th {
    background: rgba(0,0,0,0.2);
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

tbody tr {
    transition: background var(--transition-fast);
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.02);
}

tbody tr:hover {
    background: rgba(255,255,255,0.05);
}

/* Badges & Pills */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-ok { background: var(--color-success-bg); color: var(--color-success); border: 1px solid rgba(16,185,129,0.3); }
.badge-alerte { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid rgba(245,158,11,0.3); }
.badge-erreur { background: var(--color-error-bg); color: var(--color-error); border: 1px solid rgba(249,115,22,0.3); }
.badge-critique { 
    background: var(--color-critical-bg); 
    color: #fff;
    border: 1px solid var(--color-critical);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    animation: pulseCritical 2s infinite;
}

.pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    font-size: 0.75rem;
    margin: 0.1rem;
}

/* Confidence Gauge */
.confidence-gauge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    position: relative;
    background: conic-gradient(var(--color-success) 0% 100%, rgba(255,255,255,0.1) 100% 100%);
}

.confidence-gauge::before {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    background: var(--color-surface);
    border-radius: 50%;
}

.confidence-gauge span {
    position: relative;
    z-index: 1;
}

/* Detail Panel */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

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

.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 600px;
    height: 100%;
    background: var(--color-surface);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.detail-panel.open {
    transform: translateX(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: var(--color-card-bg);
}

.panel-header h2 {
    margin: 0;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.data-cards {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.data-card {
    flex: 1;
    min-width: 250px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--border-radius-md);
    padding: 1rem;
}

.data-card h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.data-content div {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed rgba(255,255,255,0.05);
    font-size: 0.9rem;
}

.data-content span:first-child {
    color: var(--color-text-muted);
}

.matching-explanation, .issues-list {
    padding: 1.5rem;
}

.issues-list ul {
    list-style: none;
}

.issues-list li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(0,0,0,0.2);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.export-section {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem;
    margin-top: auto;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Toast */
.toast-area {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--color-card-bg);
    border-left: 4px solid var(--color-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: translateX(120%);
    animation: slideInRight 0.3s forwards;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseCritical {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes slideInRight {
    to { transform: translateX(0); }
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1.5rem;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .drag-zones-container {
        flex-direction: column;
    }
    
    .upload-options {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        width: 100%;
    }
    
    .detail-panel {
        max-width: 100%;
    }
}
