/* ============================================
   Naturelle & CO - Custom Styles
   ============================================ */

:root {
    --salon-primary: #5cb85c;
    --salon-primary-dark: #449d44;
    --salon-secondary: #1b2a4a;
    --salon-dark: #0f1d36;
    --salon-light: #f0f7f0;
    --salon-accent: #8fd694;
}

.text-success {
    color: var(--salon-primary) !important;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #333;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--salon-secondary), var(--salon-primary-dark)) !important;
}

.navbar-brand {
    font-size: 1.3rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--salon-secondary), var(--salon-primary));
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
}

.hero-section > .container {
    position: relative;
    z-index: 1;
}

/* Feature icons */
.feature-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cards */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0.75rem;
}

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

.card.text-decoration-none:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

/* Product cards */
.product-card .product-img-wrapper {
    border-radius: 0.75rem 0.75rem 0 0;
}

.product-desc-truncate {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Buttons */
.btn-primary {
    background: var(--salon-primary);
    border-color: var(--salon-primary);
}

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

.btn-outline-primary {
    color: var(--salon-primary);
    border-color: var(--salon-primary);
}

.btn-outline-primary:hover {
    background: var(--salon-primary);
    border-color: var(--salon-primary);
}

/* Badges */
.badge.bg-primary {
    background-color: var(--salon-primary) !important;
}

/* Cards colored headers */
.card-header.bg-primary {
    background: var(--salon-primary) !important;
}

.card-header.bg-secondary {
    background: var(--salon-secondary) !important;
}

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stats cards */
.card.bg-primary {
    background: var(--salon-primary) !important;
}

/* Nav tabs */
.nav-tabs .nav-link.active {
    color: var(--salon-primary);
    border-bottom-color: var(--salon-primary);
    font-weight: 600;
}

.nav-tabs .nav-link {
    color: #666;
}

/* Progress bars */
.progress-bar.bg-warning {
    background: linear-gradient(90deg, #f39c12, #e74c3c) !important;
}

/* Footer */
footer {
    background: #ffffff !important;
}

/* Login card */
.card .display-4.text-primary {
    color: var(--salon-primary) !important;
}

/* Points display */
.display-1.text-warning {
    color: #f39c12 !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .hero-section .display-3 {
        font-size: 2rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .card-body .display-5 {
        font-size: 2rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Alert customization */
.alert {
    border-radius: 0.5rem;
    border: none;
}

/* Dropdown */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--salon-primary);
    box-shadow: 0 0 0 0.2rem rgba(92, 184, 92, 0.25);
}

/* Order bar */
.fixed-bottom#orderBar {
    z-index: 1050;
}

/* ============================================
   Mobile Responsive Enhancements
   ============================================ */

@media (max-width: 768px) {
    /* Touch-friendly form elements (min 44px) */
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevent iOS zoom on focus */
    }

    .form-check {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding-top: 0.15rem;
        padding-bottom: 0.15rem;
    }

    .form-check-input {
        width: 1.25em;
        height: 1.25em;
        margin-top: 0;
    }

    .form-check-label {
        padding-left: 0.25rem;
        font-size: 1rem;
    }

    /* Button touch targets */
    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-sm {
        min-height: 44px;
        padding: 0.4rem 0.75rem;
    }

    /* Page titles */
    h1.fw-bold {
        font-size: 1.4rem;
    }

    /* Stats cards text scaling */
    .card-body .fs-2 {
        font-size: 1.25rem !important;
    }

    .card-body .fs-3 {
        font-size: 1.1rem !important;
    }

    .card-body .fs-4 {
        font-size: 1rem !important;
    }

    /* Display text scaling */
    .display-4 {
        font-size: 2rem;
    }

    .display-5 {
        font-size: 1.75rem;
    }

    /* Table text sizing */
    .table {
        font-size: 0.85rem;
    }

    .table th {
        font-size: 0.75rem;
    }

    /* Nav tabs: horizontally scrollable */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
    }

    /* Disable card hover lift on touch devices */
    .card:hover {
        transform: none;
    }

    /* Client view: action buttons stacking */
    .client-actions {
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }

    .client-actions .btn {
        flex: 1 1 calc(50% - 0.5rem);
        font-size: 0.8rem;
    }

    /* Order bar mobile layout */
    .fixed-bottom#orderBar .container {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .fixed-bottom#orderBar .btn-lg {
        width: 100%;
    }

    /* Add bottom padding when order bar is visible */
    body.has-order-bar {
        padding-bottom: 140px;
    }

    /* Hair profile accordion: chevron rotation */
    .hair-profile-toggle .bi-chevron-down {
        transition: transform 0.3s ease;
    }

    .hair-profile-toggle.collapsed .bi-chevron-down {
        transform: rotate(-90deg);
    }

    /* Measurement fields: stack on small screens */
    .measurement-fields .col-4 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Container side padding */
    .container.py-4,
    .container.py-5 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Header flex wrapping */
    .d-flex.align-items-center.mb-4 > .ms-auto {
        width: 100%;
        margin-top: 0.75rem;
    }

    /* Login card padding */
    .col-md-5 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Hair profile collapse: always visible on desktop */
@media (min-width: 769px) {
    .hair-profile-collapse {
        display: block !important;
        height: auto !important;
    }
}

@media (max-width: 576px) {
    h1.fw-bold {
        font-size: 1.2rem;
    }

    /* Smaller avatar on very small screens */
    .rounded-circle[style*="width:120px"] {
        width: 80px !important;
        height: 80px !important;
    }

    img.rounded-circle[width="120"] {
        width: 80px !important;
        height: 80px !important;
    }

    /* Order status filter cards */
    .status-filter-cards .col {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .status-filter-cards .card-body {
        padding: 0.5rem !important;
    }

    /* Boutique category filters */
    .category-filters .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

/* ============================================
   Scroll Animations
   ============================================ */
[data-animate] {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-animate="fade-in"] {
    transform: none;
}

[data-animate="slide-up"] {
    transform: translateY(30px);
}

[data-animate="slide-left"] {
    transform: translateX(-30px);
}

[data-animate="slide-right"] {
    transform: translateX(30px);
}

[data-animate].is-visible {
    opacity: 1;
    transform: none;
}

/* ============================================
   Lazy Loading
   ============================================ */
img[data-src] {
    background: var(--salon-light);
    min-height: 80px;
}

img.lazy-loaded {
    animation: lazyFadeIn 0.4s ease-out;
}

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

/* ============================================
   Hero Carousel (Slider)
   ============================================ */
.hero-carousel {
    position: relative;
    overflow: hidden;
}

.hero-carousel .carousel-item {
    height: 700px;
    position: relative;
}

.hero-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-carousel .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

.hero-carousel .hero-overlay h2 {
    font-size: 2.8rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-carousel .hero-overlay p {
    font-size: 1.2rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.hero-carousel .carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.7);
    background: transparent;
    opacity: 0.7;
}

.hero-carousel .carousel-indicators .active {
    background: #fff;
    opacity: 1;
}

.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-color: rgba(0,0,0,0.4);
    border-radius: 50%;
    background-size: 50%;
    padding: 1.2rem;
}

@media (max-width: 768px) {
    .hero-carousel .carousel-item {
        height: 320px;
    }
    .hero-carousel .hero-overlay h2 {
        font-size: 1.6rem;
    }
    .hero-carousel .hero-overlay p {
        font-size: 0.95rem;
    }
}

/* ============================================
   Detail Modals
   ============================================ */
.detail-modal .modal-body img {
    max-height: 350px;
    object-fit: contain;
    width: 100%;
    border-radius: 0.5rem;
}

.detail-modal .detail-section {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.detail-modal .detail-section:last-child {
    border-bottom: none;
}

/* ============================================
   Prestations Page
   ============================================ */
.prestation-card {
    cursor: pointer;
}

.prestation-card .card-img-top {
    transition: transform 0.3s ease;
}

.prestation-card:hover .card-img-top {
    transform: scale(1.05);
}

.prestation-img-placeholder {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--salon-light);
    border-radius: 0.75rem 0.75rem 0 0;
}

/* ============================================
   Featured Products Carousel
   ============================================ */
.featured-carousel-wrapper {
    position: relative;
    padding: 0;
}

.featured-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.featured-carousel::-webkit-scrollbar {
    display: none;
}

.featured-slide {
    flex: 0 0 calc(25% - 0.75rem);
    scroll-snap-align: start;
    min-width: 0;
}

@media (max-width: 767px) {
    .featured-slide {
        flex: 0 0 calc(50% - 0.5rem);
    }
}

.featured-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.featured-nav:hover {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
}

.featured-nav-prev { left: 10px; }
.featured-nav-next { right: 10px; }

/* ============================================
   Hair Types Section
   ============================================ */
.hair-types-section {
    background: linear-gradient(135deg, #ffffff 0%, var(--salon-light) 100%);
}

/* ============================================
   Video Carousel (Naturelle page)
   ============================================ */
.video-carousel-wrapper {
    position: relative;
    padding: 0 45px;
}

.video-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.video-carousel::-webkit-scrollbar {
    display: none;
}

.video-slide {
    flex: 0 0 calc(33.333% - 0.75rem);
    scroll-snap-align: start;
    min-width: 0;
}

@media (max-width: 991px) {
    .video-slide {
        flex: 0 0 calc(50% - 0.5rem);
    }
}

@media (max-width: 767px) {
    .video-slide {
        flex: 0 0 calc(70% - 0.5rem);
    }
}

@media (max-width: 480px) {
    .video-slide {
        flex: 0 0 calc(85%);
    }
    .video-carousel-wrapper {
        padding: 0 35px;
    }
}

.video-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--salon-primary);
    background: #fff;
    color: var(--salon-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.2s;
}

.video-nav:hover {
    background: var(--salon-primary);
    color: #fff;
}

.video-nav-prev { left: 0; }
.video-nav-next { right: 0; }

/* Video Cards */
.video-card {
    cursor: pointer;
    overflow: hidden;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12) !important;
}

.video-thumbnail {
    position: relative;
    overflow: hidden;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, opacity 0.3s;
}

/* Overlay atténué pour laisser voir l'autoplay */
.video-play-overlay--autoplay {
    background: rgba(0, 0, 0, 0.1);
}

.video-play-overlay--autoplay i {
    font-size: 2.5rem;
    opacity: 0.7;
}

.video-card:hover .video-play-overlay--autoplay {
    background: rgba(0, 0, 0, 0.25);
}

.video-card:hover .video-play-overlay--autoplay i {
    opacity: 1;
}

.video-card:hover .video-play-overlay {
    background: rgba(0, 0, 0, 0.15);
}

.video-play-overlay i {
    font-size: 3.5rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, opacity 0.3s;
}

.video-card:hover .video-play-overlay i {
    transform: scale(1.15);
}

.video-duration {
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

/* ============================================
   Engagements Carousel
   ============================================ */
.engagements-carousel-wrapper {
    position: relative;
    padding: 0 45px;
}

.engagements-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.engagements-carousel::-webkit-scrollbar {
    display: none;
}

.engagement-slide {
    flex: 0 0 calc(33.333% - 0.75rem);
    scroll-snap-align: start;
    min-width: 0;
}

@media (max-width: 767px) {
    .engagement-slide {
        flex: 0 0 calc(80%);
    }
}

.engagement-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--salon-primary), var(--salon-accent));
    display: flex;
    align-items: center;
    justify-content: center;
}

.engagement-icon i {
    font-size: 1.8rem;
    color: #fff;
}

.engagement-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--salon-primary);
    background: #fff;
    color: var(--salon-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.2s;
}

.engagement-nav:hover {
    background: var(--salon-primary);
    color: #fff;
}

.engagement-nav-prev { left: 0; }
.engagement-nav-next { right: 0; }

/* ============================================
   Video Modal
   ============================================ */
#videoModal .modal-content {
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
}

#videoModal video {
    display: block;
}

/* ============================================
   Section Backgrounds (Index page)
   ============================================ */
.section-light {
    background: var(--salon-light);
}

.section-dark-gradient {
    background: linear-gradient(135deg, var(--salon-secondary), var(--salon-dark));
}

.section-accent {
    background: linear-gradient(135deg, #f0f7f0 0%, #e8f5e9 50%, #f0f7f0 100%);
}

/* ============================================
   Hair Type Cards (clickable)
   ============================================ */
@media (max-width: 767px) {
    .suivi-row {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -ms-overflow-style: none;
        scrollbar-width: none;
        gap: 1rem;
        padding-bottom: 0.5rem;
    }
    .suivi-row::-webkit-scrollbar {
        display: none;
    }
    .suivi-row > .col-md-4 {
        flex: 0 0 75%;
        max-width: 75%;
        scroll-snap-align: start;
    }
    .rewards-row {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -ms-overflow-style: none;
        scrollbar-width: none;
        gap: 1rem;
        padding-bottom: 0.5rem;
    }
    .rewards-row::-webkit-scrollbar {
        display: none;
    }
    .rewards-row > .col-md-6 {
        flex: 0 0 70%;
        max-width: 70%;
        scroll-snap-align: start;
    }
    .hair-types-row {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -ms-overflow-style: none;
        scrollbar-width: none;
        gap: 1rem;
        padding-bottom: 0.5rem;
    }
    .hair-types-row::-webkit-scrollbar {
        display: none;
    }
    .hair-types-row > .col-md-4 {
        flex: 0 0 75%;
        max-width: 75%;
        scroll-snap-align: start;
    }
}

.hair-type-card {
    cursor: pointer;
    overflow: hidden;
}

.hair-type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.15) !important;
}

.hair-type-card:hover .card-img-top {
    transform: scale(1.05);
}

.hair-type-card .card-img-top {
    transition: transform 0.4s ease;
}

.hair-type-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hair-type-card:hover .hair-type-overlay {
    opacity: 1;
}

/* Hair Type Modal */
.hair-type-modal-header {
    background: linear-gradient(135deg, var(--salon-primary-dark), var(--salon-primary));
}

.hair-type-product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hair-type-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}
