/* ============================================
   MycoGest - Refonte complète Bootstrap 5.3
   Design compact, moderne et professionnel
   ============================================ */

/* ============================================
   Variables CSS personnalisées
   ============================================ */
:root {
    /* Palette mycologique naturelle */
    --myco-brown: #8B6F47;
    --myco-beige: #D4A574;
    --myco-cream: #F5EFE7;
    --myco-dark: #4A3F35;
    --myco-green: #7D8F69;
    --myco-orange: #C87941;
    
    /* Override Bootstrap */
    --bs-primary: #8B6F47;
    --bs-primary-rgb: 139, 111, 71;
    --bs-secondary: #7D8F69;
    --bs-light: #F5EFE7;
    --bs-dark: #4A3F35;
    
    --bs-body-font-size: 0.9375rem;
    --bs-body-line-height: 1.6;
    
    /* Espacements compacts */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Ombres subtiles */
    --shadow-sm: 0 1px 2px rgba(74, 63, 53, 0.08);
    --shadow: 0 2px 4px rgba(74, 63, 53, 0.1);
    --shadow-lg: 0 4px 12px rgba(74, 63, 53, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #4A3F35;
    background: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Navigation - Compact & Fixed
   ============================================ */
.navbar {
    padding: 0.75rem 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(139, 111, 71, 0.1);
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow);
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--myco-brown) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-icon {
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    color: #4A3F35;
    transition: var(--transition);
    position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--myco-brown);
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.875rem;
    right: 0.875rem;
    height: 2px;
    background: var(--myco-brown);
    border-radius: 2px;
}

/* Button dans la nav */
.btn-nav {
    margin-left: 0.5rem;
    padding: 0.5rem 1.25rem !important;
    font-size: 0.875rem !important;
}

/* Toggle mobile */
.navbar-toggler {
    border: none;
    padding: 0.25rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    width: 22px;
    height: 2px;
    background: var(--myco-brown);
    display: block;
    position: relative;
    transition: var(--transition);
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background: var(--myco-brown);
    left: 0;
    transition: var(--transition);
}

.navbar-toggler-icon::before {
    top: -7px;
}

.navbar-toggler-icon::after {
    bottom: -7px;
}

/* ============================================
   Boutons personnalisés
   ============================================ */
.btn {
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
}

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

.btn-primary:hover {
    background: #6F5838;
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

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

.btn-light {
    background: white;
    color: var(--myco-brown);
}

.btn-light:hover {
    background: #F5EFE7;
    color: var(--myco-brown);
}

.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: white;
    background: transparent;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* ============================================
   Cartes compactes
   ============================================ */
.card {
    border: 1px solid rgba(139, 111, 71, 0.15);
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
    background: white;
}

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

.card-body {
    padding: 1.25rem;
}

/* Carte avec bordure accent */
.card-accent {
    border-left: 3px solid var(--myco-brown);
}

/* ============================================
   Sections & Espacements
   ============================================ */
section {
    padding: 2.5rem 0;
}

@media (min-width: 768px) {
    section {
        padding: 3.5rem 0;
    }
}

.section-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--myco-dark);
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
}

.section-subtitle {
    font-size: 0.9375rem;
    color: #6C6158;
    line-height: 1.6;
}

/* Background alterné */
.bg-light-custom {
    background: var(--myco-cream);
}

/* ============================================
   Hero Section - Compact
   ============================================ */
.hero {
    padding-top: 80px;
    min-height: auto;
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--myco-dark);
    margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
}

.hero-subtitle {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1.25rem;
}

/* Gradient hero */
.hero-gradient {
    background: linear-gradient(135deg, var(--myco-beige) 0%, var(--myco-brown) 100%);
    color: white;
}

.hero-gradient h1,
.hero-gradient h2,
.hero-gradient h3,
.hero-gradient p,
.hero-gradient span {
    color: white;
}

.hero-gradient .hero-title {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-gradient .hero-subtitle {
    color: rgba(255, 255, 255, 0.95);
}

/* Stats badges */
.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    font-size: 0.75rem;
    color: white;
    backdrop-filter: blur(10px);
}

/* ============================================
   Features Grid
   ============================================ */
.feature-card {
    padding: 1.25rem;
    background: white;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(139, 111, 71, 0.15);
    transition: var(--transition);
    height: 100%;
}

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

.feature-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    display: block;
}

.feature-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--myco-dark);
    margin-bottom: 0.5rem;
}

.feature-text {
    font-size: 0.8125rem;
    color: #6C6158;
    line-height: 1.5;
    margin: 0;
}

/* ============================================
   Étapes / Process
   ============================================ */
.step-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: white;
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
}

.step-number {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--myco-brown);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
}

.step-content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--myco-dark);
}

.step-content p {
    font-size: 0.8125rem;
    color: #6C6158;
    margin: 0;
}

/* ============================================
   CTA Sections
   ============================================ */
.cta-section {
    background: linear-gradient(135deg, var(--myco-beige) 0%, var(--myco-brown) 100%);
    color: white;
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    text-align: center;
}

.cta-section h2,
.cta-section h3,
.cta-section p,
.cta-section .h3 {
    color: white;
}

.cta-section h2 {
    margin-bottom: 0.75rem;
}

.cta-section p {
    opacity: 0.95;
    margin-bottom: 1.5rem;
}

/* ============================================
   Badges & Tags
   ============================================ */
.badge-custom {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: rgba(139, 111, 71, 0.1);
    color: var(--myco-brown);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================
   Footer - Compact
   ============================================ */
.footer {
    background: var(--myco-dark);
    color: #B8AFA4;
    padding: 2.5rem 0 1.5rem;
    font-size: 0.875rem;
}

.footer h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer a {
    color: #B8AFA4;
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--myco-beige);
}

.footer-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-brand:hover {
    color: white !important;
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.8125rem;
}

.footer-bottom p {
    margin: 0.25rem 0;
}

.footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

/* ============================================
   Messages / Alerts
   ============================================ */
.messages-container {
    position: fixed;
    top: 90px;
    right: 1rem;
    z-index: 1050;
    max-width: 400px;
}

.alert {
    padding: 0.875rem 1.25rem;
    border-radius: var(--border-radius);
    border-left: 4px solid;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

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

.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 0;
    margin-left: 1rem;
}

.alert-close:hover {
    opacity: 1;
}

/* ============================================
   Forms
   ============================================ */
.form-control,
.form-select {
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid rgba(139, 111, 71, 0.25);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--myco-brown);
    box-shadow: 0 0 0 0.15rem rgba(139, 111, 71, 0.15);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--myco-dark);
    margin-bottom: 0.5rem;
}

/* ============================================
   Pricing Cards
   ============================================ */
.pricing-card {
    border: 2px solid rgba(139, 111, 71, 0.15);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    background: white;
    transition: var(--transition);
    position: relative;
}

.pricing-card:hover {
    border-color: var(--myco-brown);
    box-shadow: var(--shadow-lg);
}

.pricing-card.popular {
    border-color: var(--myco-brown);
    box-shadow: var(--shadow-lg);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--myco-brown);
    color: white;
    padding: 0.375rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--myco-brown);
    margin: 1rem 0;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.pricing-features li {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pricing-features li i {
    color: var(--myco-brown);
}

/* ============================================
   Utilitaires compacts
   ============================================ */
.text-myco-brown {
    color: var(--myco-brown) !important;
}

.bg-myco-cream {
    background-color: var(--myco-cream) !important;
}

.border-myco {
    border-color: var(--myco-brown) !important;
}

/* Espacements responsifs compacts */
@media (max-width: 767.98px) {
    .pt-mobile-sm { padding-top: 1rem !important; }
    .pb-mobile-sm { padding-bottom: 1rem !important; }
    .py-mobile-sm { padding-top: 1rem !important; padding-bottom: 1rem !important; }
}

/* ============================================
   Animations subtiles
   ============================================ */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

/* Hover lift effect */
.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   Responsive - Mobile First
   ============================================ */
@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1.125rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .btn + .btn {
        margin-top: 0.5rem;
    }
}

/* Tablettes */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
}

/* Desktop */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* ============================================
   Components supplémentaires
   ============================================ */

/* Timeline vertical */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--myco-beige);
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.25rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--myco-brown);
    border: 3px solid white;
}

/* List avec icônes */
.list-icon {
    list-style: none;
    padding: 0;
}

.list-icon li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.list-icon li i {
    color: var(--myco-brown);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* Divider décoratif */
.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--myco-beige), transparent);
    margin: 2rem 0;
}

/* Badge avec point */
.badge-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    background: rgba(139, 111, 71, 0.1);
    border-radius: 50px;
    font-size: 0.8125rem;
}

.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--myco-brown);
}

/* Card avec ribbon */
.card-ribbon {
    position: relative;
    overflow: hidden;
}

.card-ribbon::before {
    content: attr(data-ribbon);
    position: absolute;
    top: 1rem;
    right: -2rem;
    transform: rotate(45deg);
    background: var(--myco-brown);
    color: white;
    padding: 0.25rem 3rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: var(--shadow);
}

/* Stats card */
.stat-card {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(139, 111, 71, 0.15);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--myco-brown);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card-label {
    font-size: 0.875rem;
    color: #6C6158;
    font-weight: 500;
}

.stat-card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

/* Gradient text */
.text-gradient {
    background: linear-gradient(135deg, var(--myco-beige) 0%, var(--myco-brown) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Image avec overlay */
.img-overlay {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
}

.img-overlay img {
    display: block;
    width: 100%;
    height: auto;
    transition: var(--transition);
}

.img-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(74, 63, 53, 0.7) 100%);
    opacity: 0;
    transition: var(--transition);
}

.img-overlay:hover::before {
    opacity: 1;
}

.img-overlay:hover img {
    transform: scale(1.05);
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid rgba(139, 111, 71, 0.2);
    border-top-color: var(--myco-brown);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--border-radius);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 0.75rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: #6C6158;
    font-size: 0.875rem;
}

/* ============================================
   Print - Optimisation
   ============================================ */
@media print {
    .navbar,
    .footer,
    .btn,
    .messages-container {
        display: none !important;
    }
    
    body {
        padding-top: 0 !important;
    }
    
    .card {
        break-inside: avoid;
    }
}
