/* ========== Variables ========== */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --dark-bg: #1e293b;
    --dark-sidebar: #0f172a;
    --light-bg: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ========== Layout ========== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ========== Sidebar ========== */
.sidebar {
    width: 260px;
    background: var(--dark-sidebar);
    color: white;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 0 1.5rem 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.sidebar-brand:hover {
    color: var(--primary-color);
}

.sidebar-brand svg {
    width: 28px;
    height: 28px;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding-left: 2rem;
}

.sidebar-nav a.active {
    background: var(--primary-color);
    color: white;
    border-right: 3px solid white;
}

.sidebar-nav a svg {
    margin-right: 0.75rem;
    width: 20px;
    height: 20px;
}

/* ========== Main Content ========== */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem 3rem;
    min-height: 100vh;
}

/* ========== Page Header ========== */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header h1 svg {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.page-header .lead {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* ========== Cards ========== */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    background: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header svg {
    width: 20px;
    height: 20px;
}

.card-body {
    padding: 1.5rem;
}

/* KPI Cards */
.kpi-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
}

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

.kpi-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.kpi-card small {
    opacity: 0.9;
}

.kpi-card .card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kpi-card .card-title svg {
    width: 24px;
    height: 24px;
}

/* ========== Buttons ========== */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-success:hover {
    background: #059669;
}

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

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

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

/* ========== Tables ========== */
.table {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.table thead th:first-child {
    border-top-left-radius: 12px;
}
.table thead th:last-child {
    border-top-right-radius: 12px;
}

.table thead th {
    background: var(--dark-bg);
    color: white;
    font-weight: 600;
    padding: 1rem;
    border: none;
}

.table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: var(--light-bg);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table-responsive {
    overflow: visible;
}


/* ========== Badges ========== */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge svg {
    width: 14px;
    height: 14px;
}

/* ========== Forms ========== */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

/* ========== Alerts ========== */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: start;
    gap: 0.75rem;
}

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* ========== Utilities ========== */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-muted { color: var(--text-secondary) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* ========== Icons ========== */
.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
}

.icon-box svg {
    width: 24px;
    height: 24px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* ===========================
   BADGES D'ALERTES - SYSTÈME AVANCÉ
   =========================== */

/* Override des badges pour les alertes spécifiques */
.badge.price-too-low {
    background-color: #dc143c;
    color: white;
    border: 2px solid #8b0000;
    font-weight: 700;
}

.badge.increase {
    background-color: #ef4444;
    color: white;
}

.badge.low-margin {
    background-color: #f59e0b;
    color: white;
}

.badge.ok-margin {
    background-color: #3b82f6;
    color: white;
}

.badge.very-good {
    background-color: #10b981;
    color: white;
}

/* ALERTES ANCIENNETÉ */
.badge.new {
    background-color: #87ceeb;
    color: #1e293b;
    font-weight: 700;
}

.badge.watch {
    background-color: #f59e0b;
    color: white;
}

.badge.liquidate {
    background-color: #ff6347;
    color: white;
    animation: pulse-alert 2s infinite;
}

/* ALERTES PRIORITAIRES */
.badge.cash-block {
    background-color: #8b0000;
    color: white;
    border: 2px solid #ff0000;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(139, 0, 0, 0.3);
}

.badge.price-anomaly {
    background-color: #ffd700;
    color: #1e293b;
    border: 2px dashed #f59e0b;
    font-weight: 600;
}

/* ALERTES ANALYSIS (historique ventes) */
.badge.fast-sale {
    background-color: #32cd32;
    color: white;
}

.badge.slow-sale {
    background-color: #f59e0b;
    color: white;
}

.badge.star {
    background-color: #ffd700;
    color: #1e293b;
    font-weight: 800;
    border: 2px solid #ffaa00;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.badge.problematic {
    background-color: #8b0000;
    color: white;
    font-weight: 600;
}

/* Animation pour À LIQUIDER */
@keyframes pulse-alert {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

/* Conteneur des badges */
.product-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* Responsive pour les badges */
@media (max-width: 768px) {
    .badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    .product-alerts {
        gap: 4px;
    }
}

/* Couleurs de base (ajuste si besoin) */
:root {
    --rc-primary: #0d6efd;
    --rc-primary-soft: #e0e7ff;
    --rc-text-main: #111827;
}

/* Corps */
body {
    color: var(--rc-text-main);
}

/* NAV */
header nav a.btn-link {
    color: #6b7280;
    transition: color 0.2s ease, transform 0.15s ease;
}

header nav a.btn-link:hover {
    color: var(--rc-primary);
    transform: translateY(-1px);
}

/* Boutons globaux */
.btn {
    border-radius: 999px;
    transition: background-color 0.2s ease, color 0.2s ease,
                box-shadow 0.2s ease, transform 0.15s ease;
}

.btn-primary {
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.btn-outline-secondary:hover {
    transform: translateY(-1px);
}

/* Cartes (landing + “Pour qui ?” + features) */
.card.border-0.shadow-sm {
    border-radius: 1.1rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card.border-0.shadow-sm:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

/* Carte “Ce que tu vois dans Resell Control” */
.card-header.bg-primary {
    border-top-left-radius: 1.1rem;
    border-top-right-radius: 1.1rem;
}

/* Badges */
.badge {
    border-radius: 999px;
}

/* Sections */
section {
    scroll-margin-top: 80px; /* pour ancres type #features */
}

/* Auth (login / register) */
.auth-card {
    border-radius: 1.25rem;
    box-shadow: 0 18px 45px rgba(15,23,42,.08);
}

.auth-card .form-control {
    border-radius: 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-card .form-control:focus {
    border-color: var(--rc-primary);
    box-shadow: 0 0 0 0.15rem rgba(13,110,253,.25);
}

/* Lien “retour accueil” */
.auth-card a.btn-link {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-card a.btn-link:hover {
    color: var(--rc-primary);
    text-decoration: underline;
}


/* ========= Variables ========= */
:root {
    --rc-primary: #0d6efd;
    --rc-primary-soft: #e0e7ff;
    --rc-text-main: #111827;
}

/* ========= Base ========= */
body {
    background-color: #f5f5f7;
    color: var(--rc-text-main);
}

/* ========= NAV ========= */
header nav a.btn-link {
    color: #6b7280;
    transition: color 0.2s ease, transform 0.15s ease;
}

header nav a.btn-link:hover {
    color: var(--rc-primary);
    transform: translateY(-1px);
}

/* ========= Boutons ========= */
.btn {
    border-radius: 999px;
    transition: background-color 0.2s ease, color 0.2s ease,
                box-shadow 0.2s ease, transform 0.15s ease;
}

.btn-primary {
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.btn-outline-secondary:hover,
.btn-outline-light:hover {
    transform: translateY(-1px);
}

/* ========= Cartes ========= */
.card.border-0.shadow-sm {
    border-radius: 1.1rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card.border-0.shadow-sm:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

/* Carte hero droite */
.card-header.bg-primary {
    border-top-left-radius: 1.1rem;
    border-top-right-radius: 1.1rem;
}

/* ========= Badges ========= */
.badge {
    border-radius: 999px;
}

/* ========= Sections & ancres ========= */
section {
    scroll-margin-top: 80px;
}

/* ========= Auth (login / register) ========= */
.auth-wrapper {
    min-height: 100vh;
}

.auth-card {
    border-radius: 1.25rem;
    box-shadow: 0 18px 45px rgba(15,23,42,.08);
}

.auth-card .form-control {
    border-radius: 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-card .form-control:focus {
    border-color: var(--rc-primary);
    box-shadow: 0 0 0 0.15rem rgba(13,110,253,.25);
}

.auth-badge {
    border-radius: 999px;
    padding: .25rem .75rem;
    font-size: .75rem;
}

/* Lien “retour accueil” */
.auth-card a.btn-link {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-card a.btn-link:hover {
    color: var(--rc-primary);
    text-decoration: underline;
}

/* ========= Animation d’apparition (scroll) ========= */
.fade-section {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-section.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ========= Ajout ========= */

.nav-cta {
    border-radius: 999px;
    padding-inline: 1.75rem;
    box-shadow: 0 12px 25px rgba(79, 70, 229, 0.4);
}


.hero-animated-bg {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at top left, #e0ecff, #f9fafb);
    z-index: 0;
}

.hero-animated-bg::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 0% 0%, rgba(59,130,246,0.25), transparent 55%),
                radial-gradient(circle at 100% 100%, rgba(37,99,235,0.18), transparent 55%);
    opacity: 0.75;
    animation: heroGradientFlow 22s ease-in-out infinite alternate;
    z-index: -1;
}

@keyframes heroGradientFlow {
    0% {
        transform: translate3d(-10px, -10px, 0) scale(1);
    }
    50% {
        transform: translate3d(18px, 12px, 0) scale(1.03);
    }
    100% {
        transform: translate3d(-8px, 16px, 0) scale(1.01);
    }
}

/* Respecte les préférences d’accessibilité */
@media (prefers-reduced-motion: reduce) {
    .hero-animated-bg::before {
        animation: none;
    }
}


.btn-primary,
.btn-outline-secondary,
.btn-outline-light,
.btn-light {
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, background-color 0.15s ease-out, color 0.15s ease-out;
}

.btn-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-light:hover,
.btn-light:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}

/* Underline animé pour les liens type \"Voir ce que ça fait\" */
.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    transform: scaleX(0);
    transform-origin: bottom left;
    transition: transform 0.2s ease-out;
}

.link-underline:hover::after {
    transform: scaleX(1);
}


html {
  scroll-behavior: smooth;
}
