:root {
    --primary-orange: #ff4b00;
    --pure-white: #ffffff;
    --secondary-purple: #4e006e;
    --black: #000000;
    --light-gray: #f8f9fa;
    --border-gray: #e9ecef;
    --text-muted: #666666;
    --card-bg: rgba(255, 255, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    color: var(--black);
    background-color: var(--light-gray);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background-color: var(--pure-white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    flex: 1;
    display: flex;
    align-items: center;
}

.logo {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

.search-container {
    flex: 2;
    display: flex;
    justify-content: center;
    position: relative;
    max-width: 600px;
    margin: 0 30px;
}

.search-bar {
    width: 100%;
    padding: 14px 100px 14px 25px;
    border-radius: 50px;
    border: 1px solid var(--border-gray);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    background-color: var(--pure-white);
    color: var(--black);
}

.search-bar::placeholder {
    color: #888;
}

.search-bar:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 4px rgba(255, 75, 0, 0.1);
    background-color: var(--pure-white);
}

.search-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

.search-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--primary-orange);
}

.contact-container {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

/* Glassmorphism Pill Button on Nav */
.btn-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 50px;
    background: rgba(255, 75, 0, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 75, 0, 0.2);
    color: var(--primary-orange);
    text-decoration: none;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 75, 0, 0.05);
}

.btn-contact:hover {
    background: rgba(255, 75, 0, 0.15);
    border-color: rgba(255, 75, 0, 0.3);
    box-shadow: 0 6px 20px rgba(255, 75, 0, 0.12);
    transform: translateY(-2px);
}


/* Hero Section */
.hero-section {
    margin-top: 70px;
    flex: 1;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    /* Premium fallback and image */
    background-color: #ffffff;
    background-image: url('../IMAGES/Copilot bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Desktop only â€” overridden on mobile below */
    /* Fade-in for premium feel */
    animation: heroFadeIn 1.2s ease-out forwards;
}

@keyframes heroFadeIn {
    from { opacity: 0; filter: blur(10px); }
    to { opacity: 1; filter: blur(0); }
}

/* Dynamic overlay */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6); /* Retour Ã  l'overlay fixe noir */
    z-index: 1;
}

.content-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    text-align: center;
}

.main-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.title-inline-logo {
    max-height: 45px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: fadeInDown 0.8s ease-out forwards;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-title {
    color: var(--pure-white);
    font-size: 2.3rem;
    font-weight: 700;
    margin-bottom: 0;
    text-shadow: 0 4px 12px rgba(0,0,0,0.3);
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 40px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* 6 Categories Grid */
.categories-grid {
    display: grid;
    /* 3 items per line */
    grid-template-columns: repeat(3, 1fr);
    gap: 30px; /* Increased gap for better breathing room */
    margin: 0 auto;
    max-width: 950px; /* Rebalanced width */
}

/* Category Card with Glassmorphism */
.category-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 20px;
    text-decoration: none;
    color: var(--pure-white);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    text-align: left; /* AlignÃ© Ã  gauche */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.app-tag {
    background: rgba(255, 75, 0, 0.15); /* Orange as it was initially */
    color: var(--pure-white);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(255, 75, 0, 0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.category-card:hover .app-tag {
    background: var(--secondary-purple); /* Hover changes to Violet */
    border-color: var(--secondary-purple);
}

.card-image-wrapper {
    width: 100%;
    height: 240px;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Skeleton shimmer before image loads */
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.06) 25%,
        rgba(255,255,255,0.12) 50%,
        rgba(255,255,255,0.06) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite;
}

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

/* Stop shimmer once image is loaded (handled by img display) */
.card-image-wrapper:has(.card-image) {
    background: rgba(255, 255, 255, 0.05);
    animation: none;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: block;
}

.card-image.warm-filter {
    filter: sepia(0.2) saturate(1.1) brightness(1.05);
}

.category-card:hover .card-image {
    transform: scale(1.1);
}

/* Glossy highlight effect */
.category-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    transition: all 0.6s ease;
}

.category-card:hover::after {
    left: 200%;
}

.category-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 40px rgba(78, 0, 110, 0.3);
}

/* Hover dynamic line top */
.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-orange), var(--secondary-purple));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover::before {
    opacity: 1;
}

.icon-wrapper {
    width: 45px;
    height: 45px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.category-card:hover .icon-wrapper {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.icon-wrapper svg {
    width: 24px;
    height: 24px;
    fill: var(--pure-white);
    transition: all 0.3s ease;
}

.category-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    margin: 0;
    line-height: 1.4;
}

/* Responsive constraints */
@media (max-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 850px) {
    .navbar {
        height: auto;
        padding: 15px 0;
    }
    .nav-container {
        flex-wrap: wrap;
        gap: 15px;
        padding: 0 20px;
    }
    .logo-container {
        flex: 1;
        min-width: 40%;
    }
    .contact-container {
        flex: 1;
        min-width: 40%;
    }
    .btn-contact {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
    .search-container {
        flex: 100%;
        max-width: 100%;
        order: 3;
        margin: 0;
    }
    .hero-section {
        margin-top: 130px; /* offset for thicker flex-wrapped navbar */
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 1.8rem;
        padding: 0 10px;
    }
    .page-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
        padding: 0 10px;
    }
    .search-bar {
        font-size: 0.95rem;
        padding: 14px 50px 14px 20px;
    }
    .hero-section {
        background-attachment: scroll; /* Fix iOS Safari bug */
    }
    .categories-grid {
        gap: 20px;
    }
    .modal-content {
        padding: 30px 20px;
    }
}

@media (max-width: 600px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
    .page-title {
        font-size: 1.6rem;
    }
    .btn-contact {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    .logo {
        max-height: 30px;
    }
    .icon-wrapper {
        width: 40px;
        height: 40px;
    }
    .icon-wrapper svg {
        width: 20px;
        height: 20px;
    }
    .card-image-wrapper {
        height: 180px;
    }
}

/* Footer */
.footer {
    background-color: var(--pure-white);
    padding: 15px 0;
    text-align: center;
    border-top: 1px solid var(--border-gray);
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.footer-container p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.card-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.learn-more {
    display: inline-block;
    margin-top: auto; /* Pushes the link to the bottom of the card */
    padding-top: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pure-white);
    transition: all 0.3s ease;
    text-align: left;
}

.category-card:hover .learn-more {
    transform: translateX(5px);
    color: var(--primary-orange); /* Orange au survol pour plus d'impact */
    text-shadow: 0 0 8px rgba(255, 75, 0, 0.4);
}

/* Search Suggestions Dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #ffffff;
    border-radius: 16px;
    margin-top: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000;
    overflow: hidden;
    border: 1px solid var(--border-gray);
}

.search-suggestions.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.suggestion-header {
    padding: 12px 20px 8px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: rgba(0,0,0,0.02);
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-gray);
    cursor: pointer;
    color: var(--black);
    background: #ffffff;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(255, 75, 0, 0.05);
}

.suggestion-icon {
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--primary-orange), var(--secondary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
}

.suggestion-text {
    display: flex;
    flex-direction: column;
}

.suggestion-main-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--black);
    line-height: 1.2;
}

.suggestion-main-title.orange {
    color: var(--primary-orange);
}

.suggestion-main-title.gray {
    color: #555;
}

.suggestion-cat-tag, .suggestion-sub-title.black {
    color: var(--black);
    font-weight: 500;
    opacity: 1;
}

/* Hybrid AI CTA */
.hybrid-ai-cta {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #fff, #fff3ee);
    border: 1px dashed var(--primary-orange);
    border-radius: 15px;
    text-align: center;
    animation: slideUp 0.5s ease;
}

.btn-ask-ai {
    margin-top: 15px;
    padding: 12px 24px;
    background: var(--primary-orange);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-ask-ai:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 20px rgba(255, 75, 0, 0.3);
}

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

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

/* TTS Button Style */
.tts-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s ease;
    border-radius: 5px;
}

.tts-btn:hover {
    color: var(--secondary-purple);
    background: rgba(78, 0, 110, 0.05);
}

.tts-btn.speaking {
    color: var(--primary-orange);
    animation: pulseScale 1s infinite;
}

@keyframes pulseScale {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Active press effect */
.category-card:active {
    transform: scale(0.98);
}

.suggestion-cat-tag.orange {
    color: var(--primary-orange);
    opacity: 1;
}

.history-item .suggestion-icon {
    color: #999;
    background: none;
    -webkit-text-fill-color: initial;
}

.q-suggestion .suggestion-icon, 
.cat-suggestion .suggestion-icon {
    color: var(--secondary-purple);
    background: none;
    -webkit-text-fill-color: initial;
    opacity: 1;
}
#noResults {
    display: none;
    margin-top: 50px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    color: var(--pure-white);
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

#noResults.visible {
    display: block;
}

#noResults p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Back to Top Button */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-orange);
    color: var(--pure-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 75, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(255, 75, 0, 0.4);
}


.search-bar {
    width: 100%;
    padding: 12px 100px 12px 20px;
    border: 1px solid var(--border-gray);
    border-radius: 30px;
    font-size: 0.95rem;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.9);
}

.search-bar:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 4px rgba(255, 75, 0, 0.1);
    background: #fff;
}

.voice-search-btn {
    position: absolute;
    right: 55px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--black);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-search-btn:hover {
    color: var(--primary-orange);
    background: rgba(255, 75, 0, 0.05);
}

.voice-search-btn.listening {
    color: #ff0000;
    animation: pulseMic 1.5s infinite;
}

@keyframes pulseMic {
    0% { transform: translateY(-50%) scale(1); box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4); }
    70% { transform: translateY(-50%) scale(1.1); box-shadow: 0 0 0 10px rgba(255, 0, 0, 0); }
    100% { transform: translateY(-50%) scale(1); box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
}

.search-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-orange);
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s ease;
}



/* Noscript banner */
.noscript-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--primary-orange);
    color: #fff;
    text-align: center;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Premium Contact Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(78, 0, 110, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInModal 0.3s forwards;
}

.modal-content {
    background: #fff;
    width: 95%;
    max-width: 1000px;
    height: 90vh;
    border-radius: 28px;
    box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.96) translateY(20px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.close-modal {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 32px;
    font-weight: 300;
    color: var(--black);
    cursor: pointer;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: var(--primary-orange);
    color: #fff;
    transform: rotate(90deg);
}

.modal-header {
    padding: 40px 40px 25px;
    background: linear-gradient(135deg, #fff 0%, #fef8ff 100%);
    border-bottom: 1px solid #f1f5f9;
}

.modal-header h2 {
    color: var(--primary-purple);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.modal-header p {
    color: #64748b;
    font-size: 1rem;
    max-width: 600px;
}

.modal-body {
    flex-grow: 1;
    position: relative;
    background: #f8fafc;
    padding: 20px;
    overflow: hidden;
}

#contactIframe {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

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

@media (max-width: 768px) {
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    .modal-header {
        padding: 30px 20px 20px;
    }
    .modal-header h2 {
        font-size: 1.5rem;
    }
}

