/**
 * GUIDE BOOSTLINGO - SIPSE
 * Design moderne et professionnel
 */

/* ================================================
   FONTS & RESET
   ================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
    /* Couleurs principales - Palette moderne */
    --primary: #0066FF;
    --primary-hover: #0052CC;
    --primary-light: #E6F0FF;

    /* Sidebar - Light modern */
    --sidebar-bg: #FFFFFF;
    --sidebar-hover: #F8FAFC;
    --sidebar-active: #EEF2FF;
    --sidebar-border: #E5E7EB;

    /* Texte */
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    --text-white: #FFFFFF;
    --text-sidebar: #374151;
    --text-sidebar-muted: #6B7280;

    /* Fonds */
    --bg-page: #F9FAFB;
    --bg-card: #FFFFFF;
    --bg-hover: #F3F4F6;

    /* Bordures */
    --border: #E5E7EB;
    --border-light: #F3F4F6;

    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    /* Dimensions */
    --sidebar-width: 280px;
    --header-height: 64px;
    --content-max-width: 1100px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;

    /* Border radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ================================================
   LAYOUT
   ================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ================================================
   SIDEBAR
   ================================================ */
.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sidebar-header:hover {
    background: var(--sidebar-hover);
}

.sidebar-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 12px;
}

.sidebar-title {
    display: block;
    width: 200px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

/* Navigation Menu */
.nav-menu {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}

.nav-section {
    margin-bottom: 4px;
}

.nav-section-btn {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-sidebar);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.nav-section-btn:hover:not(:disabled) {
    background: var(--sidebar-hover);
    color: var(--primary);
}

.nav-section-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-section-btn .text {
    flex: 1;
}

.nav-section-btn .arrow {
    font-size: 12px;
    color: var(--text-sidebar-muted);
    transition: transform var(--transition);
    transform: rotate(-90deg);
}

.nav-section-btn.active {
    background: var(--sidebar-active);
    border-left-color: var(--primary);
    color: var(--primary);
}

.nav-section-btn.active .arrow {
    transform: rotate(0deg);
}

.nav-section-btn .badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    background: var(--bg-page);
    border-radius: 100px;
    color: var(--text-sidebar-muted);
}

.nav-section-btn .count {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    background: var(--primary-light);
    border-radius: 100px;
    color: var(--primary);
}

/* Submenu */
.nav-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: var(--bg-page);
}

.nav-submenu.open {
    max-height: 500px;
}

.nav-submenu li a {
    display: block;
    padding: 10px 20px 10px 56px;
    color: var(--text-sidebar-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.nav-submenu li a:hover {
    background: var(--sidebar-hover);
    color: var(--text-sidebar);
    border-left-color: var(--border);
}

.nav-submenu li a.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
}

/* Subsection dans le menu */
.nav-subsection {
    padding: 0;
}

.nav-subsection-title {
    display: block;
    padding: 10px 20px 6px 40px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-sidebar);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-subguides {
    list-style: none;
}

.nav-subguides li a {
    display: block;
    padding: 8px 20px 8px 56px;
    color: var(--text-sidebar-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.nav-subguides li a:hover {
    background: var(--sidebar-hover);
    color: var(--text-sidebar);
    border-left-color: var(--border);
}

.nav-subguides li a.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
}

/* ================================================
   HEADER
   ================================================ */
.content-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumb-home {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.breadcrumb-home:hover {
    color: var(--primary);
}

.breadcrumb .separator {
    color: var(--border);
    font-size: 12px;
}

.breadcrumb-section {
    color: var(--text-secondary);
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* ================================================
   CONTENT BODY
   ================================================ */
.content-body {
    flex: 1;
    padding: 32px;
    max-width: calc(var(--content-max-width) + 64px);
    margin: 0 auto;
    width: 100%;
}

/* ================================================
   WELCOME PAGE
   ================================================ */
.welcome-page {
    animation: fadeIn 0.4s ease;
}

.welcome-header {
    text-align: center;
    margin-bottom: 48px;
    padding: 48px 0;
}

.welcome-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.welcome-header p {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Section Cards */
.section-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform var(--transition);
}

.card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card:hover::before {
    transform: scaleX(1);
}

.card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.card-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: 100px;
}

/* ================================================
   GUIDE PAGE
   ================================================ */
.guide-page {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    animation: fadeIn 0.4s ease;
}

.guide-header {
    padding: 32px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(to bottom, var(--bg-page), var(--bg-card));
}

.guide-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.source-link {
    display: none; /* Caché car non utilisé */
}

.guide-content {
    padding: 32px;
}

/* Option Groups - Timeline style */
.option-group {
    display: flex;
    gap: 0;
    margin-bottom: 48px;
    position: relative;
}

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

.option-title {
    position: relative;
    width: 100px;
    flex-shrink: 0;
    padding-right: 24px;
    text-align: right;
}

.option-title-text {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 100px;
}

.option-steps {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-left: 28px;
    border-left: 2px solid #E0E7FF;
    position: relative;
}

/* Steps */
.step {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
    position: relative;
}

/* Connecteur vers la ligne */
.step::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 28px;
    width: 12px;
    height: 2px;
    background: #E0E7FF;
}

.step:hover {
    border-color: #C7D2FE;
    box-shadow: var(--shadow);
}

.step-number {
    flex-shrink: 0;
    min-width: 36px;
    height: 28px;
    padding: 0 10px;
    background: #EEF2FF;
    color: #4F46E5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-content h4 {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0;
    line-height: 1.5;
}

.step-image {
    margin-top: 16px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.step-image img {
    display: block;
    width: 100%;
    height: auto;
}

/* Tip Box - Style info vert */
.tip-box {
    display: flex;
    gap: 14px;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    align-items: flex-start;
    position: relative;
}

/* Connecteur vers la ligne pour tip-box */
.tip-box::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 24px;
    width: 12px;
    height: 2px;
    background: #A7F3D0;
}

.tip-icon {
    width: 22px;
    height: 22px;
    background: #10B981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    color: white;
    font-weight: 700;
}

.tip-icon::after {
    content: 'i';
    font-family: 'Georgia', serif;
    font-style: italic;
}

.tip-box p {
    font-size: 14px;
    color: #065F46;
    line-height: 1.6;
}

/* ================================================
   GUIDE NAVIGATION
   ================================================ */
.guide-navigation {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 32px;
    background: var(--bg-page);
    border-top: 1px solid var(--border);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition);
    max-width: 48%;
}

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

.nav-btn.next {
    flex-direction: row-reverse;
    text-align: right;
    margin-left: auto;
}

.nav-arrow {
    font-size: 18px;
    color: var(--primary);
    font-weight: 600;
}

.nav-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.nav-spacer {
    flex: 1;
}

/* ================================================
   OVERLAY
   ================================================ */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* ================================================
   SCROLLBAR
   ================================================ */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

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

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1024px) {
    .section-cards {
        grid-template-columns: 1fr;
    }

    .content-body {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .content-header {
        padding: 0 16px;
    }

    .content-body {
        padding: 16px;
    }

    .welcome-header {
        padding: 32px 0;
    }

    .welcome-header h1 {
        font-size: 28px;
    }

    .welcome-header p {
        font-size: 15px;
    }

    .guide-header {
        padding: 24px;
    }

    .guide-header h1 {
        font-size: 20px;
    }

    .guide-content {
        padding: 24px;
    }

    /* Timeline mobile */
    .option-group {
        flex-direction: column;
        gap: 12px;
    }

    .option-title {
        width: auto;
        text-align: left;
        padding-right: 0;
        padding-bottom: 8px;
        border-bottom: 2px solid #E0E7FF;
    }

    .option-title-text {
        position: static;
    }

    .option-steps {
        border-left: none;
        padding-left: 0;
    }

    .step::before,
    .tip-box::before {
        display: none;
    }

    .step {
        flex-direction: row;
        padding: 16px;
    }

    .step-number {
        min-width: 32px;
        height: 24px;
        font-size: 12px;
    }

    .guide-navigation {
        flex-direction: column;
        padding: 16px 24px;
    }

    .nav-btn {
        max-width: 100%;
    }

    .nav-btn.next {
        flex-direction: row-reverse;
        margin-left: 0;
    }

    .breadcrumb {
        font-size: 13px;
    }

    .breadcrumb-current {
        display: none;
    }
}

@media (max-width: 480px) {
    .guide-header,
    .guide-content,
    .guide-navigation {
        padding-left: 16px;
        padding-right: 16px;
    }

    .option-steps {
        gap: 16px;
    }

    .step {
        padding: 16px;
    }
}

/* ================================================
   PRINT STYLES
   ================================================ */
@media print {
    .sidebar,
    .content-header,
    .guide-navigation,
    .menu-toggle {
        display: none !important;
    }

    .content {
        margin-left: 0 !important;
    }

    .guide-page {
        border: none;
        box-shadow: none;
    }
}
