/* eBay SNIPER v2 - INTERFACE MODERNE & FLUIDE */

:root {
    /* Palette de couleurs moderne */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary: #06b6d4;
    --accent: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Neutres - Thème sombre */
    --gray-50: #0f172a;  /* Très sombre - fond principal */
    --gray-100: #1e293b; /* Sombre - fonds secondaires */
    --gray-200: #334155; /* Moyen-sombre - bordures */
    --gray-300: #475569; /* Moyen - éléments inactifs */
    --gray-400: #64748b; /* Moyen-clair - texte secondaire */
    --gray-500: #94a3b8; /* Clair - texte principal */
    --gray-600: #cbd5e1; /* Très clair - texte accentué */
    --gray-700: #e2e8f0; /* Presque blanc - texte sur fond sombre */
    --gray-800: #f1f5f9; /* Blanc cassé - texte sur fond coloré */
    --gray-900: #f8fafc; /* Blanc pur - texte sur éléments actifs */

    /* Espacement mobile-first */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Bordures et effets */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);

    /* Animations */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    color: var(--gray-700); /* Texte clair sur fond sombre */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Règle générale pour assurer le contraste de tous les éléments de texte */
* {
    color: inherit; /* Hériter de la couleur parente */
}

/* Layout principal */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header moderne */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    animation: grain 20s steps(10) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0) }
    10% { transform: translate(-5%, -10%) }
    20% { transform: translate(-15%, 5%) }
    30% { transform: translate(7%, -25%) }
    40% { transform: translate(-5%, 25%) }
    50% { transform: translate(-15%, 10%) }
    60% { transform: translate(15%, 0%) }
    70% { transform: translate(0%, 15%) }
    80% { transform: translate(3%, -10%) }
    90% { transform: translate(-10%, 5%) }
}

.header-content {
    position: relative;
    z-index: 2;
    padding: var(--spacing-lg);
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.access-panel {
    display: grid;
    gap: 0.35rem;
    max-width: min(100%, 24rem);
    padding: 0.9rem 1rem;
    border-radius: var(--border-radius-lg);
    background: rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 24px rgb(15 23 42 / 0.12);
}

.access-panel.readonly {
    background: rgba(120, 53, 15, 0.24);
    border-color: rgba(251, 191, 36, 0.28);
}

.access-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.access-badge.readonly {
    background: rgba(245, 158, 11, 0.22);
}

.access-description {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.84rem;
    line-height: 1.45;
}

.access-admin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 2.25rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
    transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.access-admin-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.access-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 2.25rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(239, 68, 68, 0.18);
    color: #fff;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
}

.access-logout-btn:hover {
    background: rgba(239, 68, 68, 0.28);
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
}

.access-logout-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.ui-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.ui-icon i,
.ui-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ui-icon svg {
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.logo-icon {
    width: 3.25rem;
    height: 3.25rem;
    padding: 0.38rem;
    border-radius: 1rem;
    color: white;
    background: linear-gradient(135deg, rgb(255 255 255 / 0.18), rgb(255 255 255 / 0.08));
    border: 1px solid rgb(255 255 255 / 0.24);
    box-shadow: 0 10px 24px rgb(15 23 42 / 0.18);
}

.logo-icon .ui-icon {
    width: 100%;
    height: 100%;
}

.brand-logo-image {
    width: 100%;
    height: 100%;
    display: block;
}

.logo-title-row {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
}

.version {
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 500;
    white-space: nowrap;
}

.status-section {
    margin-top: var(--spacing-lg);
}

.live-section {
    margin-top: 0;
    display: grid;
    gap: var(--spacing-md);
}

.live-status-card {
    margin-top: 0;
}

.status-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
    display: grid;
    gap: var(--spacing-md);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.status-indicator-main {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-sm);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: fit-content;
    padding: 0.6rem 0.85rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.status-summary {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
}

.status-subline {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.82);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray-400);
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px currentColor;
}

.status-dot.connected {
    background: var(--success);
    animation: none;
}

.status-dot.idle {
    background: #f59e0b;
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.error {
    background: var(--danger);
    animation: none;
}

.countdown-line {
    font-size: 0.875rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.status-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-md);
}

.status-overview-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.9rem;
    border-radius: var(--border-radius-md);
    background: rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 74px;
}

.status-overview-card-primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.34) 0%, rgba(79, 70, 229, 0.28) 100%);
    border-color: rgba(255, 255, 255, 0.18);
}

.status-overview-label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.status-overview-value {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--gray-900);
    font-variant-numeric: tabular-nums;
}

.live-action-card {
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.live-action-copy {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: min(100%, 20rem);
    flex: 1;
}

.live-action-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.live-action-description {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.78);
    max-width: 54ch;
}

.live-actions-grid {
    display: grid;
    gap: var(--spacing-md);
    margin-top: 0;
}

.live-action-card-danger {
    border-color: rgba(239, 68, 68, 0.24);
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.28) 0%, rgba(69, 10, 10, 0.22) 100%);
}

.live-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 46px;
    padding: 0.85rem 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.92) 0%, rgba(79, 70, 229, 0.96) 100%);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast), background var(--transition-fast);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.25);
}

.live-action-btn-danger {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.94) 0%, rgba(153, 27, 27, 0.98) 100%);
    box-shadow: 0 12px 24px rgba(153, 27, 27, 0.28);
}

.live-action-btn span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

.live-action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(79, 70, 229, 0.32);
}

.live-action-btn-danger:hover:not(:disabled) {
    box-shadow: 0 16px 28px rgba(153, 27, 27, 0.36);
}

.live-action-btn:disabled {
    opacity: 0.68;
    cursor: not-allowed;
    box-shadow: none;
}

.live-action-btn.is-loading {
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.92) 0%, rgba(51, 65, 85, 0.96) 100%);
}

.live-action-btn .ui-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

@media (max-width: 420px) {
    .status-overview-grid {
        grid-template-columns: 1fr;
    }

    .live-action-btn {
        width: 100%;
    }

    .access-panel {
        width: 100%;
    }
}

/* Navigation par onglets */
.nav-tabs {
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    color: var(--gray-700); /* Texte clair sur fond sombre */
}

/* Assurer que tous les éléments de texte dans la navigation ont une couleur appropriée */
.nav-tabs * {
    color: inherit;
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--spacing-md) var(--spacing-sm);
    background: none;
    border: none;
    color: var(--gray-400); /* Texte secondaire sur fond sombre */
    font-size: 0.75rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    border-radius: 0;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--gray-200);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: white;
    border-radius: 2px;
}

.tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    transition: transform var(--transition-fast);
}

.tab-icon .ui-icon {
    width: 100%;
    height: 100%;
}

.tab-btn:hover .tab-icon {
    transform: scale(1.1);
}

/* Contenu principal */
.main-content {
    flex: 1;
    padding: var(--spacing-lg);
    padding-bottom: 100px; /* Espace pour le FAB */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    color: var(--gray-700); /* Plus foncé pour meilleur contraste */
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: var(--spacing-lg);
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(2) {
    animation-delay: 0.2s;
    border-top-color: var(--secondary);
}

.spinner-ring:nth-child(3) {
    animation-delay: 0.4s;
    border-top-color: var(--accent);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-screen h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.loading-screen p {
    opacity: 0.7;
}

/* Sections de paramètres */
.section {
    background: var(--gray-50); /* Légèrement plus foncé pour meilleur contraste */
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    animation: slideInUp 0.5s ease-out;
    position: relative;
    overflow: hidden;
    color: var(--gray-800); /* Assurer couleur de texte appropriée */
}

/* Assurer que tous les éléments de texte dans les sections ont une couleur appropriée */
.section * {
    color: inherit;
}

.section p, .section span, .section div {
    color: var(--gray-700);
}

body.readonly-mode .field-input:disabled,
body.readonly-mode .slider:disabled,
body.readonly-mode .checkbox-container input:disabled + .checkmark {
    cursor: not-allowed;
}

body.readonly-mode .field-input:disabled,
body.readonly-mode .slider:disabled {
    opacity: 0.72;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.section-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    box-shadow: 0 10px 22px rgb(99 102 241 / 0.18);
}

.section-icon .ui-icon {
    width: 1.4rem;
    height: 1.4rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900); /* Noir pour contraste maximal */
    margin: 0;
}

.section-description {
    color: var(--gray-400); /* Texte secondaire sur fond sombre */
    font-size: 0.875rem;
    margin-top: var(--spacing-sm);
}

/* Champs de formulaire */
.field-group {
    margin-bottom: var(--spacing-lg);
}

.field-group:last-child {
    margin-bottom: 0;
}

.field-label {
    display: block;
    font-weight: 500;
    color: var(--gray-800); /* Plus foncé pour meilleur contraste */
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
}

.field-description {
    display: block;
    color: var(--gray-400); /* Texte secondaire sur fond sombre */
    font-size: 0.75rem;
    margin-top: 4px;
}

/* Sliders modernes */
.slider-container {
    position: relative;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--gray-200);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: all var(--transition-fast);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    border: 3px solid white;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    cursor: pointer;
    box-shadow: var(--shadow-md);
    border: 3px solid white;
    transition: all var(--transition-fast);
}

.slider-value {
    position: absolute;
    top: -35px;
    right: 0;
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    transform: translateX(0); /* Valeur toujours visible */
    opacity: 1; /* Valeur toujours visible */
    transition: all var(--transition-fast);
    pointer-events: none;
}

.slider-container:hover .slider-value {
    transform: translateX(0); /* Déjà en place */
}

/* Inputs texte */
.field-input {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--gray-300); /* Bordure plus foncée */
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    background: white;
    color: var(--gray-900); /* Texte noir pour contraste maximal */
}

.field-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
    background: white; /* Assurer fond blanc au focus */
}

/* Bouton flottant */
.floating-actions {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 1000;
}

.save-fab {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    border: none;
    border-radius: var(--border-radius-xl);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.save-fab:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgb(16 185 129 / 0.5);
}

.save-fab:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-md);
}

.fab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
}

.fab-icon .ui-icon {
    width: 100%;
    height: 100%;
}

.fab-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    animation: pulse-ring 2s infinite;
    opacity: 0;
}

.save-fab:not(:disabled) .fab-pulse {
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        width: 0;
        height: 0;
        opacity: 0.7;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* États */
.modified .save-fab {
    background: linear-gradient(135deg, var(--warning), #d97706);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    left: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 1001;
    pointer-events: none;
}

.toast {
    background: var(--gray-200);
    color: var(--gray-700);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-xl);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 500;
    animation: slideInRight 0.3s ease-out;
    pointer-events: auto;
    border-left: 4px solid var(--primary);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-icon {
    width: 1rem;
    height: 1rem;
}

/* Animations d'entrée */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .header-content {
        padding: var(--spacing-md);
    }

    .main-content {
        padding: var(--spacing-md);
    }

    .section {
        padding: var(--spacing-md);
    }

    .tab-btn {
        padding: var(--spacing-sm);
        font-size: 0.7rem;
    }

    .tab-icon {
        width: 1rem;
        height: 1rem;
    }
}

/* Checkboxes modernes */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    user-select: none;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
}

.checkbox-container:hover {
    background: var(--gray-50);
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    position: relative;
    transition: all var(--transition-fast);
    background: white;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-text {
    font-size: 0.875rem;
    color: var(--gray-800); /* Plus foncé pour meilleur contraste */
}

/* Contenu des onglets */
.tab-content {
    animation: fadeIn 0.3s ease-out;
}

/* === STYLES POUR FICHIERS DEBUG === */

.debug-files-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.debug-file-item {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    transition: all var(--transition-normal);
    flex-wrap: wrap;
}

.debug-file-item:hover {
    background: var(--gray-200);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.file-info {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.95rem;
    word-break: break-word;
}

.file-date {
    font-size: 0.875rem;
    color: var(--gray-400);
}

.file-size {
    font-size: 0.875rem;
    color: var(--gray-400);
}

.file-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.debug-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.icon-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.icon-label .ui-icon {
    width: 0.95rem;
    height: 0.95rem;
}

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

.debug-view:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.debug-download {
    background: var(--secondary);
    color: white;
}

.debug-download:hover {
    background: #0891b2;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.debug-delete {
    background: #b91c1c;
    color: white;
}

.debug-delete:hover {
    background: #991b1b;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.loading-text {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--gray-400);
    font-size: 0.95rem;
}

.loading-text.icon-label {
    justify-content: center;
}

/* === STATS DASHBOARD === */

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.stat-card {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    text-align: center;
    transition: transform var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-top: 4px;
}

.stat-card-primary { border-left: 3px solid var(--primary); }
.stat-card-primary .stat-number { color: var(--primary-light); }
.stat-card-success { border-left: 3px solid var(--success); }
.stat-card-success .stat-number { color: var(--success); }
.stat-card-warning { border-left: 3px solid var(--warning); }
.stat-card-warning .stat-number { color: var(--warning); }
.stat-card-danger { border-left: 3px solid var(--danger); }
.stat-card-danger .stat-number { color: var(--danger); }
.stat-card-go { border-left: 3px solid #10b981; }
.stat-card-go .stat-number { color: #10b981; }
.stat-card-nogo { border-left: 3px solid #ef4444; }
.stat-card-nogo .stat-number { color: #ef4444; }

/* Barre de taux GO */
.stats-go-rate {
    margin-top: var(--spacing-md);
    text-align: center;
}

.go-rate-bar {
    width: 100%;
    height: 12px;
    background: var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}

.go-rate-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 6px;
    transition: width 1s ease;
}

.go-rate-reliability {
    background: linear-gradient(90deg, #6366f1, #a5b4fc);
}

.go-rate-label {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* Donut chart */
.donut-chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
}

.donut-chart {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-hole {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--gray-50);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.donut-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-700);
}

.donut-label {
    font-size: 0.7rem;
    color: var(--gray-400);
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Barres horizontales (scores) */
.bars-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.bar-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bar-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
}

.bar-duo {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bar-tag {
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}

.bar-tag-all { color: var(--gray-500); }
.bar-tag-go { color: #10b981; }

.bar-track {
    flex: 1;
    height: 24px;
    background: var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    transition: width 1s ease;
    min-width: 40px;
}

.bar-fill-go {
    border: 2px dashed rgba(255,255,255,0.4);
}

.bar-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

/* Prix */
.price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.price-block {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
}

.price-block h4 {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: var(--spacing-sm);
}

.price-block-go {
    border-left: 3px solid #10b981;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.85rem;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
}

.price-row:last-child {
    border-bottom: none;
}

.price-row strong {
    color: var(--gray-700);
}

.price-row-profit strong {
    color: #10b981;
    font-size: 1rem;
}

/* Graphique quotidien */
.daily-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 200px;
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    overflow-x: auto;
}

.daily-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 40px;
}

.daily-bar-wrapper {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.daily-bar {
    width: 70%;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 4px;
    transition: height 0.8s ease;
}

.daily-bar-go {
    width: 100%;
    background: #10b981;
    border-radius: 4px 4px 0 0;
    position: absolute;
    bottom: 0;
    left: 0;
}

.daily-label {
    font-size: 0.65rem;
    color: var(--gray-400);
    margin-top: 4px;
    white-space: nowrap;
}

.daily-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-500);
}

/* Distribution (histogramme) */
.distrib-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 200px;
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) 0;
}

.distrib-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 50px;
}

.distrib-bar-wrapper {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.distrib-bar {
    width: 80%;
    background: linear-gradient(180deg, #6366f1, #4f46e5);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.8s ease;
}

.distrib-bar-price {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.distrib-label {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 4px;
    white-space: nowrap;
}

.distrib-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
}

/* Top opportunités */
.offers-section {
    overflow: hidden;
}

.offers-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    background: rgba(15, 23, 42, 0.18);
    border: 1px solid var(--gray-200);
}

.offers-toolbar-summary {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.offers-count-pill,
.offers-sort-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gray-700);
    background: rgba(99, 102, 241, 0.14);
    border: 1px solid rgba(165, 180, 252, 0.2);
}

.offers-sort-controls {
    display: flex;
    align-items: stretch;
    gap: var(--spacing-sm);
}

.offers-sort-inline-description {
    flex: 1;
    min-width: 220px;
    display: flex;
    align-items: center;
    padding: 0.72rem 0.9rem;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(165, 180, 252, 0.16);
    background: rgba(99, 102, 241, 0.08);
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--gray-500);
}

.offers-sort-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.offers-sort-caption {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-400);
}

.offers-sort-select {
    min-width: 220px;
    padding: 0.7rem 0.85rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.88rem;
    font-weight: 600;
}

.offers-sort-order {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.72rem 0.9rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.offers-sort-order:hover {
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.offers-sort-order-icon {
    font-size: 1rem;
}

.top-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

@media (min-width: 1180px) {
    .top-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
        align-items: start;
    }
}

@media (max-width: 979px) and (min-width: 700px) and (orientation: landscape) {
    .top-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
        align-items: start;
    }
}

@media (min-width: 1560px) {
    .top-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1920px) {
    .top-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 2440px) {
    .top-list {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.top-item {
    display: block;
    min-width: 0;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.top-item:hover {
    border-color: var(--success);
    box-shadow: var(--shadow-md);
}

.top-compact-row {
    display: block;
    min-width: 0;
}

.top-preview {
    position: relative;
    width: 100%;
    min-width: 0;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    border-radius: 0;
    background: rgba(15, 23, 42, 0.04);
}

.top-preview-rank {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 0.26rem 0.62rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.74);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #f8fafc;
    font-size: 0.82rem;
    font-weight: 800;
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.22);
}

.top-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.top-preview-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-preview-placeholder {
    padding: 0.8rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.78rem;
    font-weight: 700;
}

.top-media {
    width: min(280px, 100%);
    min-width: 0;
    margin-bottom: 1rem;
}

.top-media-empty {
    display: flex;
    align-items: center;
}

.top-media-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-md);
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.16), rgba(226, 232, 240, 0.52));
    color: var(--gray-500);
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px dashed rgba(148, 163, 184, 0.35);
}

.top-carousel {
    display: grid;
    gap: 0.55rem;
}

.top-carousel-viewport {
    overflow: hidden;
    border-radius: var(--border-radius-md);
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.2);
    aspect-ratio: 4 / 3;
}

.top-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.26s ease;
}

.top-carousel-slide {
    min-width: 100%;
    height: 100%;
}

.top-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.top-carousel-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.top-carousel-btn {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: rgba(255, 255, 255, 0.72);
    color: var(--gray-700);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.top-carousel-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(99, 102, 241, 0.24);
}

.top-carousel-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.top-carousel-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex: 1;
}

.top-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: none;
    background: rgba(148, 163, 184, 0.42);
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease;
}

.top-carousel-dot.is-active {
    background: var(--secondary);
    transform: scale(1.15);
}

.top-info {
    min-width: 0;
    padding: 1rem;
}

.top-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--gray-700);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.4;
}

.top-meta {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    min-width: 0;
    margin-top: 4px;
    font-size: 0.8rem;
}

.top-price { color: var(--gray-500); }
.top-resale { color: var(--secondary); }
.top-profit { color: var(--success); font-weight: 700; }

.top-meta .ui-icon {
    width: 0.92rem;
    height: 0.92rem;
}

.top-metrics {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
    margin-top: 6px;
}

.top-metric-chip {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--gray-500);
    border: 1px solid rgba(165, 180, 252, 0.12);
}

.top-scores {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.top-ai-block {
    display: grid;
    gap: 0.8rem;
    min-width: 0;
    margin-top: 0.95rem;
}

.top-ai-section {
    padding: 0.9rem 1rem;
    border-radius: var(--border-radius-md);
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.2);
    min-width: 0;
}

.top-ai-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.top-ai-label {
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--gray-500);
}

.top-ai-text {
    margin: 0;
    color: var(--gray-700);
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.top-ai-text-negotiation {
    color: var(--gray-800);
}

.top-copy-btn {
    flex-shrink: 0;
    border: 1px solid rgba(14, 116, 144, 0.18);
    background: rgba(14, 116, 144, 0.08);
    color: var(--gray-900);
    border-radius: 999px;
    padding: 0.52rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.top-copy-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    background: rgba(14, 116, 144, 0.14);
    border-color: rgba(14, 116, 144, 0.3);
}

.top-copy-btn:disabled {
    opacity: 0.62;
    cursor: not-allowed;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--gray-200);
    border-radius: 12px;
    color: var(--gray-500);
}

.score-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.78rem;
    height: 0.78rem;
}

.score-badge-global {
    background: var(--success);
    color: white;
    font-weight: 700;
}

.top-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: 0;
    max-width: 100%;
    min-height: 42px;
    padding: 0.62rem 0.9rem;
    border-radius: var(--border-radius-md);
    background: linear-gradient(135deg, #0f766e, #0e7490);
    color: white;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 10px 24px rgba(14, 116, 144, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.top-link-row {
    display: flex;
    justify-content: flex-start;
    min-width: 0;
    margin-top: 0.85rem;
}

.top-link-row-details {
    justify-content: center;
}

.top-details {
    margin-top: 0.8rem;
    margin-bottom: 0;
}

.top-details:not([open]) {
    margin-bottom: 1rem;
}

.top-details-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 240px;
    min-height: 42px;
    margin: 0 auto;
    padding: 0.62rem 2.2rem 0.62rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.18);
    background: rgba(99, 102, 241, 0.07);
    gap: 0.75rem;
    cursor: pointer;
    list-style: none;
    color: var(--gray-600);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.top-details-toggle:hover {
    background: rgba(99, 102, 241, 0.11);
    border-color: rgba(99, 102, 241, 0.28);
    transform: translateY(-1px);
}

.top-details-toggle::-webkit-details-marker {
    display: none;
}

.top-details-title {
    display: block;
    text-align: center;
    overflow-wrap: anywhere;
}

.top-details-label-open {
    display: none;
}

.top-details[open] .top-details-label-closed {
    display: none;
}

.top-details[open] .top-details-label-open {
    display: inline;
}

.top-details-icon {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.details-toggle-icon {
    width: 0.95rem;
    height: 0.95rem;
}

.top-details[open] .top-details-icon {
    transform: translateY(-50%) rotate(180deg);
}

.top-details-body {
    margin-top: 0.95rem;
    padding-top: 0.95rem;
    padding-right: 1rem;
    padding-bottom: 1rem;
    padding-left: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.top-price,
.top-resale,
.top-profit,
.top-link-label {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.top-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(14, 116, 144, 0.24);
    filter: brightness(1.03);
}

.top-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-link-icon-svg {
    width: 0.98rem;
    height: 0.98rem;
}

.carousel-btn-icon {
    width: 0.95rem;
    height: 0.95rem;
}

.top-link-label {
    white-space: nowrap;
}

@media (max-width: 980px) {
    .top-preview {
        width: 100%;
    }

    .top-media {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .offers-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .offers-sort-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .offers-sort-select {
        min-width: 0;
        width: 100%;
    }

    .offers-sort-inline-description {
        min-width: 0;
    }

    .offers-sort-order {
        justify-content: center;
    }

    .top-ai-row {
        flex-direction: column;
        align-items: stretch;
    }

    .top-copy-btn {
        width: 100%;
    }

    .top-link-row {
        justify-content: center;
    }

    .top-link {
        width: auto;
        min-width: 0;
    }

    .debug-file-item {
        align-items: stretch;
    }

    .file-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--spacing-sm);
    }

    .debug-btn {
        width: 100%;
        min-width: 0;
        padding-inline: var(--spacing-sm);
    }

    .debug-btn span {
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Nettoyage BDD */
.cleanup-container {
    margin-top: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.cleanup-btn {
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--border-radius-md);
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cleanup-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

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

.cleanup-status {
    min-height: 24px;
}

.cleanup-running {
    color: var(--warning);
    font-weight: 600;
    animation: pulse 1.5s infinite;
}

.cleanup-error {
    color: var(--danger);
    font-weight: 600;
}

.cleanup-result {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    font-weight: 600;
    color: var(--gray-600);
}

.cleanup-btn .ui-icon,
.cleanup-status .ui-icon,
.file-info .ui-icon,
.debug-btn .ui-icon,
.toast-icon .ui-icon {
    width: 0.95rem;
    height: 0.95rem;
}

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

/* Animation pour les toasts */
.toast.show {
    opacity: 1;
    transform: translateX(0);
}