/**
 * Styles personnalisés pour Quiz SAAQ
 * Complète Tailwind CSS avec des styles spécifiques
 */

/* ===== Variables CSS ===== */
:root {
    --primary: #0047FF;
    --success: #10B981;
    --dark: #1F2937;
    --light: #F9FAFB;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}

/* ===== Smooth Scroll ===== */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* ===== Navigation ===== */
.nav-link {
    position: relative;
    color: #4B5563;
    font-weight: 600;
    transition: var(--transition);
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Navbar avec effet de scroll */
nav.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ===== Navbar Mobile Style Application ===== */
@media (max-width: 768px) {
    nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        z-index: 40;
        background: white;
        border-top: 1px solid #E5E7EB;
        box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
        padding: 0;
        height: auto;
    }

    nav .container {
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 0.5rem 0;
        height: 60px;
        max-width: 100%;
    }

    nav .flex {
        display: flex;
        flex-direction: row;
        gap: 0;
        width: 100%;
        justify-content: space-around;
    }

    nav .hidden {
        display: none !important;
    }

    #mobile-menu {
        display: none !important;
    }

    #mobile-menu-button {
        display: none !important;
    }

    .md\:flex {
        display: none !important;
    }

    main {
        padding-bottom: 70px;
    }

    footer {
        margin-bottom: 70px;
    }

    nav a {
        padding: 0.5rem;
        font-size: 0.75rem;
        text-align: center;
    }

    nav .inline-flex {
        display: none;
    }
}

/* ===== Boutons ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #0038CC 100%);
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(0, 71, 255, 0.3);
    display: inline-block;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 71, 255, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    transition: var(--transition);
    border: 2px solid var(--primary);
    display: inline-block;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 71, 255, 0.3);
}

/* Form input styles */
.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    font-size: 1rem;
    color: #374151;
    background-color: #F9FAFB;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 71, 255, 0.2);
    outline: none;
}

/* ===== Cards ===== */
.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: 1px solid #E5E7EB;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary);
}

.category-card {
    background: white;
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    text-align: center;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-color: var(--primary);
}

.testimonial-card {
    background: white;
    padding: 2rem;
    border-radius: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    height: 100%;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

/* ===== FAQ Accordéon ===== */
.faq-item {
    transition: var(--transition);
    border-radius: 0.5rem;
    overflow: hidden;
}

.faq-item:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.faq-question {
    cursor: pointer;
    background-color: #F3F4F6;
    border-bottom: 1px solid #E5E7EB;
}

.faq-item.active .faq-question {
    background-color: var(--primary);
    color: white;
    border-bottom-color: var(--primary);
}

.faq-item.active .faq-question span {
    color: white;
}

.faq-item.active .faq-question i {
    color: white;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    background-color: white;
    border: 1px solid #E5E7EB;
    border-top: none;
    padding: 0 1.5rem;
}

.faq-item.active .faq-answer {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.faq-question i {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

/* ===== Scroll to Top Button ===== */
#scroll-to-top {
    transition: var(--transition);
}

#scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 71, 255, 0.4);
}

/* ===== Hero Section ===== */
.hero-section {
    position: relative;
    min-height: 600px;
}

/* ===== Formulaire de contact ===== */
#contact-form input,
#contact-form select,
#contact-form textarea {
    font-family: 'Nunito', sans-serif;
}

#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
    outline: none;
}

/* Message de succès/erreur du formulaire */
#form-message.text-green-600 {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #10B981;
    padding: 0.75rem;
    border-radius: 0.375rem;
}

#form-message.text-red-600 {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #EF4444;
    padding: 0.75rem;
    border-radius: 0.375rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    h1 {
        font-size: 2rem !important;
    }
    
    .feature-card,
    .category-card,
    .testimonial-card {
        padding: 1.5rem;
    }
}

/* ===== Utilities ===== */
.shadow-custom {
    box-shadow: 0 10px 40px -10px rgba(0, 71, 255, 0.3);
}

.gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #0038CC 100%);
}

.gradient-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

/* ===== Loading Animation ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* ===== Print Styles ===== */
@media print {
    nav,
    footer,
    #scroll-to-top,
    #contact {
        display: none;
    }
}

/* ===== Accessibility ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible pour l'accessibilité */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== Performance Optimizations ===== */
img {
    max-width: 100%;
    height: auto;
}

/* Lazy loading placeholder */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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