/* ==========================================================================
   SwissCBD Custom Styles - Built with UIkit Framework
   Following UIkit 3 best practices for color system organization
   
   COLOR SYSTEM ARCHITECTURE:
   1. PALETTE LEVEL (--swisscbd-*): Static base colors - never change during runtime
   2. FUNCTIONAL LEVEL (--color-*, --text-*, --bg-*, --border-*): Semantic colors for theming
   3. COMPONENT LEVEL (--hero-*, --contact-*, etc.): Local component customizations
   4. UIKIT OVERRIDES (--uk-*): Override UIkit default variables when needed
   
   This architecture allows for:
   - Easy theme switching by changing functional variables
   - Consistent color usage across components
   - Proper separation of concerns
   - Better maintainability and scalability
   ========================================================================== */

/* ==========================================================================
   SwissCBD Color System - Following UIkit Best Practices
   ========================================================================== */

/* 1. PALETTE LEVEL - Base colors (static) */
:root {
    /* Primary SwissCBD Colors */
    --swisscbd-green-primary: rgb(153, 204, 102);
    --swisscbd-green-light: rgba(153, 204, 102, 0.6);
    --swisscbd-green-dark: rgb(122, 163, 82);
    
    /* Neutral Colors */
    --swisscbd-gray-50: #f8f9fa;
    --swisscbd-gray-100: #e5e5e5;
    --swisscbd-gray-900: #3c3c3c;
    
    /* Accent Colors */
    --swisscbd-blue: #39f;
    --swisscbd-white: #ffffff;
    --swisscbd-black: #000000;
}

/* 2. FUNCTIONAL LEVEL - Theme colors (semantic) */
:root {
    /* Brand & Primary */
    --color-primary: var(--swisscbd-green-primary);
    --color-primary-light: var(--swisscbd-green-light);
    --color-primary-dark: var(--swisscbd-green-dark);
    
    /* Text Colors */
    --text-primary: var(--swisscbd-gray-900);
    --text-secondary: var(--swisscbd-gray-900);
    --text-light: var(--swisscbd-white);
    --text-muted: #6c757d;
    
    /* Background Colors */
    --bg-primary: var(--swisscbd-white);
    --bg-secondary: var(--swisscbd-gray-50);
    --bg-dark: var(--swisscbd-gray-900);
    
    /* Border Colors */
    --border-default: var(--swisscbd-gray-100);
    --border-primary: var(--color-primary);
    
    /* State Colors */
    --color-success: var(--color-primary);
    --color-accent: var(--swisscbd-blue);
}

/* 3. UIKIT OVERRIDES - Customize UIkit variables */
:root {
    /* Override UIkit success color to match SwissCBD brand */
    --uk-text-success-color: var(--color-success);
    --uk-button-primary-background: var(--color-primary);
    --uk-button-primary-hover-background: var(--color-primary-dark);
}

/* Typographie globale */
body {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

/* Header z-index pour être au-dessus de tous les overlays */
.tm-header,
.tm-header-mobile {
    z-index: 1000 !important;
}

/* Mobile header improvements */
.tm-header-mobile .uk-navbar-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.tm-header-mobile .uk-navbar-toggle {
    color: var(--text-primary);
    padding: 8px;
}

.tm-header-mobile .uk-logo img {
    height: 35px;
    max-height: 35px;
}

/* Mobile menu modal styling */
#tm-mobile.uk-modal .uk-modal-dialog {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

#tm-mobile .uk-modal-close-full {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    top: 20px;
    right: 20px;
}

.uk-navbar-container {
    z-index: 1001 !important;
}

/* Navbar sticky - z-index encore plus élevé */
.uk-navbar-sticky {
    z-index: 1010 !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Logo styling */
.logo {
    height: 50px;
    width: auto;
}

/* Liseret vert sous la navbar - UIkit component customization */
.uk-navbar-container {
    border-bottom: 3px solid var(--border-primary);
}

/* UIkit overrides for consistent branding */
.uk-text-success {
    color: var(--color-success) !important;
}

/* Boutons primary - Style global pour la charte graphique */
.uk-button-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 5px 20px var(--color-primary-light);
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.uk-button-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--color-primary-light) !important;
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary)) !important;
}

/* Navigation links - using UIkit navbar hooks */
.uk-navbar-nav > li > a {
    color: var(--text-primary) !important;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    padding: 10px 20px;
    border-radius: 5px;
    position: relative;
}

.uk-navbar-nav > li:hover > a,
.uk-navbar-nav > li.uk-active > a {
    color: var(--text-primary) !important;
    background-color: var(--color-primary-light);
}

.uk-navbar-nav > li > a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 5px;
    left: 50%;
    background-color: var(--color-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.uk-navbar-nav > li:hover > a::after {
    width: 70%;
}

/* Mobile menu styling */
.uk-nav-primary > li > a {
    font-size: 1.5rem !important;
    padding: 15px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin: 5px 0;
    color: var(--text-primary) !important;
    display: block;
    text-align: center;
}

.uk-nav-primary > li:hover > a,
.uk-nav-primary > li:active > a {
    background-color: var(--color-primary-light);
    color: var(--text-primary) !important;
    transform: scale(1.05);
}

/* ==========================================================================
   HERO SECTION - Component Level Colors
   ========================================================================== */



/* Hero Section UIkit avec Cover - Structure conforme documentation 
   Z-index layers: 
   - Image de fond (uk-cover): z-index auto
   - Overlay: z-index 5
   - Contenu (hero-card): z-index 10
*/
#accueil {
    position: relative;
}

/* Hero Card - Design moderne et élégant */
.hero-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 10;
    transition: all 0.3s ease;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    z-index: 1;
}

.hero-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.hero-card .uk-card-title {
    font-size: 3rem;
    font-weight: 800;
    color: #2c3e50;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    letter-spacing: -1px;
    line-height: 1.1;
    position: relative;
    z-index: 2;
}

.hero-card .uk-text-success {
    color: var(--color-primary) !important;
    font-weight: 900;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-card .uk-text-meta {
    color: #7f8c8d;
    font-weight: 600;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 1;
}

/* Hero Card Body - Design moderne */
.hero-card .uk-card-body {
    position: relative;
    z-index: 2;
}

.hero-card .uk-card-body h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.hero-card .uk-card-body h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
}

.hero-card .uk-card-body p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #34495e;
    text-align: left;
    opacity: 1;
    font-weight: 450;
}

/* Hero Card Footer - Modern button design */
.hero-card .uk-card-footer {
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.5);
}

.hero-card .uk-card-footer .uk-button-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border: none;
    box-shadow: 0 4px 15px rgba(153, 204, 102, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 12px;
    padding: 12px 30px;
    position: relative;
    overflow: hidden;
}

.hero-card .uk-card-footer .uk-button-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.hero-card .uk-card-footer .uk-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(153, 204, 102, 0.4);
}

.hero-card .uk-card-footer .uk-button-primary:hover::before {
    left: 100%;
}

/* Responsive Hero Section */
@media (max-width: 960px) {
    .hero-card {
        margin: 0 10px;
        border-radius: 16px;
    }
    
    .hero-card .uk-card-title {
        font-size: 2.5rem;
    }
    
    .hero-card .uk-card-body h3 {
        font-size: 1.2rem;
    }
    
    .hero-card .uk-card-body p {
        font-size: 0.95rem;
    }
    
    .hero-card .uk-card-footer .uk-button-primary {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    .hero-card {
        margin: 0 10px;
        border-radius: 12px;
        padding: 15px;
    }
    
    .hero-card .uk-card-title {
        font-size: 1.8rem;
        letter-spacing: -0.5px;
        line-height: 1.2;
    }
    
    .hero-card .uk-text-meta {
        font-size: 0.9rem;
        letter-spacing: 0.5px;
    }
    
    /* Layout mobile : passage en 1 colonne */
    .hero-card .uk-card-body .uk-grid-medium {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .hero-card .uk-card-body .uk-grid-medium > div {
        width: 100% !important;
    }
    
    .hero-card .uk-card-body h3 {
        font-size: 1rem;
        margin-bottom: 0.6rem;
        text-align: center;
    }
    
    .hero-card .uk-card-body h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .hero-card .uk-card-body p {
        font-size: 0.85rem;
        line-height: 1.5;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .hero-card .uk-card-footer .uk-button-primary {
        padding: 12px 20px;
        font-size: 0.9rem;
        letter-spacing: 0.5px;
        width: 100%;
    }
}

/* Extra small devices (phones < 480px) */
@media (max-width: 480px) {
    .hero-card {
        margin: 0 5px;
        border-radius: 10px;
        padding: 12px;
    }
    
    .hero-card .uk-card-title {
        font-size: 1.6rem;
    }
    
    .hero-card .uk-text-meta {
        font-size: 0.8rem;
    }
    
    .hero-card .uk-card-body h3 {
        font-size: 0.95rem;
    }
    
    .hero-card .uk-card-body p {
        font-size: 0.8rem;
    }
    
    .hero-card .uk-card-footer .uk-button-primary {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    /* Mobile menu improvements for very small screens */
    .uk-nav-primary > li > a {
        font-size: 1.3rem !important;
        padding: 12px 15px;
        margin: 3px 0;
    }
    
    /* Mobile header adjustments */
    .tm-header-mobile .uk-logo img {
        height: 30px;
        max-height: 30px;
    }
}



/* ==========================================================================
   PRODUCTION SECTION - UIkit Section Component Customization
   ========================================================================== */

.production-section {
    background-color: var(--bg-secondary);
    padding: 80px 0;
}

.production-section .uk-heading-line > span {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 700;
    padding: 0 30px;
}

.production-section .uk-text-lead {
    color: var(--color-primary);
    font-size: 1.2rem;
    font-weight: 500;
}



/* Cultivation method component */
.cultivation-method {
    padding: 60px 0;
    border-bottom: 1px solid var(--color-primary-light);
}

.cultivation-method:last-child {
    border-bottom: none;
}

.cultivation-content {
    padding: 20px 0;
}

.cultivation-title {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0;
}

.cultivation-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border: none;
    margin: 20px 0 30px 0;
    border-radius: 2px;
}

.cultivation-description {
    color: var(--text-primary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 25px;
}

.cultivation-features {
    margin: 0;
    padding: 0;
}

.cultivation-features li {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 8px;
    padding-left: 25px;
    position: relative;
}

.cultivation-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-primary);
    font-weight: bold;
    font-size: 1.1rem;
}

.cultivation-gallery {
    padding: 20px 0;
}

.cultivation-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.cultivation-image-large {
    height: 300px;
}

.cultivation-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

/* ==========================================================================
   FEATURES SECTION - Images uniformes pour les types de culture
   ========================================================================== */

.features-section .el-image {
    width: 250px !important;
    height: 200px !important;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.features-section .el-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* ==========================================================================
   CONTACT SECTION - UIkit Section Component Customization
   ========================================================================== */

/* Character count styling */
.character-count {
    text-align: right;
    margin-top: 5px;
}

/* Animations pour les messages d'alerte */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.uk-alert-success,
.uk-alert-danger {
    animation: slideInDown 0.3s ease-out;
}

/* ==========================================================================
   FOOTER - UIkit Section Component Customization
   ========================================================================== */

footer {
    background-color: var(--bg-dark) !important;
    color: var(--text-light);
    padding: 40px 0;
}

footer p {
    color: #e0e0e0;
    margin: 0;
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .production-section {
        padding: 50px 0;
    }
    
    .production-section .uk-heading-line > span {
        font-size: 1.8rem;
    }
    
    .cultivation-method {
        padding: 40px 0;
    }
    
    .cultivation-title {
        font-size: 1.6rem;
    }
    
    .cultivation-image,
    .cultivation-image-large {
        height: 180px;
    }
}

/* Animation d'entrée */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cultivation-method {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Mobile viewport fix */
@media (max-width: 640px) {
    body {
        overflow-x: hidden;
    }
    
    .uk-container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Hero section mobile adjustments */
    #accueil {
        min-height: 100vh;
        min-height: 100dvh; /* Dynamic viewport height */
    }
    
    .hero-card .uk-card-header,
    .hero-card .uk-card-body,
    .hero-card .uk-card-footer {
        padding: 15px;
    }
}

/* ==========================================================================
   CUSTOM SCROLLBAR - Using UIkit color system
   ========================================================================== */

/* Cache la barre de défilement - Version renforcée */
html, body {
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE/Edge */
    overflow-x: hidden;
}

/* Chrome, Safari, Edge, Opera */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

/* Assure que le scroll fonctionne toujours */
html, body {
    overflow-y: auto;
    height: 100%;
}

/* Cache également les barres horizontales */
* {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

*::-webkit-scrollbar {
    display: none !important;
}

/* ==========================================================================
   HERO SECTION FIXES - Replace inline styles with clean CSS
   ========================================================================== */

/* Hero overlay styling - z-index pour Cover */
.hero-overlay {
    background: rgba(0, 0, 0, 0.4);
    z-index: 5;
    pointer-events: none;
}

/* Hero content card styling - Moved to main hero card section above */

/* Premium Section - Structure UIKit conforme avec contain */
.premium-section {
    min-height: 400px;
    background-image: url('images/filigran.svg');
    display: flex;
    align-items: center;
    padding: 60px 0;
}

.premium-overlay {
    background: rgba(255, 255, 255, 0.05);
    z-index: 1;
    pointer-events: none;
}

.premium-section .uk-container {
    z-index: 2;
}

.premium-section .uk-heading-hero {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.premium-section .uk-text-lead {
    color: var(--color-primary);
    font-weight: 500;
}

/* Premium Section responsive */
@media (max-width: 640px) {
    .premium-section {
        min-height: 300px;
    }
    
    .premium-section .uk-heading-hero {
        font-size: 2rem;
    }
}

/* ==========================================================================
   END OF STYLES
   ========================================================================== */

/* ==========================================================================
   FORM UTILITY CLASSES - Replace inline styles
   ========================================================================== */

/* Hidden elements - Replaces style="display: none;" */
.hidden {
    display: none !important;
}

.submit-text.hidden {
    display: none;
}

.submit-text {
    display: inline;
}

.form-honeypot {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Enhanced honeypot hiding - Multiple methods to ensure bots can't detect */
.honeypot-container,
.form-security-fields {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    display: block !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    z-index: -1 !important;
    tab-index: -1 !important;
}

.honeypot-container input,
.honeypot-container textarea,
.form-security-fields input,
.form-security-fields textarea {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Rate limiting visual feedback */
.form-rate-limited {
    border: 2px solid #ff6b6b !important;
    background-color: rgba(255, 107, 107, 0.1) !important;
}

.form-rate-limited-message {
    color: #ff6b6b;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 5px;
    border-left: 4px solid #ff6b6b;
}

/* Security validation states */
.security-check-passed {
    border-left: 4px solid #28a745 !important;
}

.security-check-failed {
    border-left: 4px solid #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.1) !important;
}

/* Spam content detected styling */
.spam-detected {
    border: 2px solid #ff6b6b !important;
    background-color: rgba(255, 107, 107, 0.1) !important;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.3) !important;
}

/* Enhanced submit button security states */
.submit-btn-secured {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    border-color: #28a745 !important;
}

.submit-btn-security-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14) !important;
    border-color: #ffc107 !important;
    color: #000 !important;
}

.submit-spinner {
    display: none;
}

.submit-spinner.active {
    display: inline-block;
}

.error-message {
    display: none;
    margin-top: 5px;
    font-weight: 500;
}

.error-message.visible {
    display: block;
}

#formMessages {
    display: none;
}

#formMessages.visible {
    display: block;
}

#formMessages .uk-alert-success,
#formMessages .uk-alert-danger {
    display: none;
}

#formMessages .uk-alert-success.visible,
#formMessages .uk-alert-danger.visible {
    display: block;
    animation: slideInDown 0.3s ease-out;
}