/* =========================================================
   STYLEFUNCTIONS.CSS - ANIMATIES, WIDGETS & MEDIA QUERIES
   ========================================================= */

/* --- ZWEVENDE AI WIDGET & CHATBOX STRUCTUUR --- */
.ai-widget-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
}

/* Ronde launcher-knop */
.ai-launcher-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-launcher-btn:hover {
    transform: scale(1.1);
}

.ai-icon {
    font-size: 28px;
}

.ai-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--success-color);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid var(--card-color);
}

/* De pop-up chatbox venster */
.ai-chat-box {
    display: none; /* Wordt getoggled via JS */
    flex-direction: column;
    width: 380px;
    height: 516px;
    background-color: var(--card-color);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Header van de chatbox */
.ai-chat-header {
    background-color: #f8fafc;
    padding: 14px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: bold;
}

.ai-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.ai-close-btn:hover {
    color: #ef4444;
}

/* Container voor de iframe */
.ai-chat-body {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    background-color: #ffffff;
}

/* Gradio iframe trucje om de onderbalk netjes te verbergen */
.ai-chat-body iframe {
    height: calc(100% + 40px) !important;
    margin-bottom: -40px;
    border: none;
    background-color: transparent;
}

/* --- CHAT BERICHBTBALLONNEN --- */
.chat-messages-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
    overflow-y: auto;
    max-height: 400px;
    padding-right: 5px;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 75%;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
    animation: fadeIn 0.25s ease-out forwards;
}

/* Bericht van de gebruiker (Rechts, blauw) */
.message-bubble.user {
    background-color: var(--accent-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* Bericht van de chatbot (Links, lichtgrijs) */
.message-bubble.bot {
    background-color: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

/* Subtiel pulse-effect tijdens het laden van antwoorden */
.message-bubble.loading {
    color: var(--text-muted);
    font-style: italic;
    animation: pulse 1.5s infinite ease-in-out;
}

/* Inputbox elementen */
.chat-input-box {
    display: flex;
    flex: 1;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 8px 15px;
    align-items: center;
}

.chat-input-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    flex: 1;
}

.chat-input-box input::placeholder {
    color: var(--text-muted);
}

/* Algemene modals scroll functionaliteit */
.modal-content {
    background: var(--card-color);
    padding: 25px;
    border-radius: 12px;
    max-width: 460px;
    width: 90%;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* --- CSS ANIMATIES --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* --- RESPONSIEF DESIGN & MEDIA QUERIES --- */
@media (max-width: 950px) {
    .container {
        grid-template-columns: 1fr;
    }
    .hero-section {
        grid-template-columns: 1fr;
    }
    .hero-image {
        display: none;
    }
    .navbar {
        padding: 0 20px;
    }
    .navbar nav {
        display: none; /* Verbergt desktop menu-items op mobiel */
    }
}

@media (max-width: 450px) {
    .ai-chat-box {
        width: calc(100vw - 40px);
        height: 70vh;
        bottom: 10px;
        right: 10px;
    }
}
/* --- POP-UP MODAL FUNCTIE EN ACHTERGROND --- */
.modal {
    display: none; /* Wordt getoggled via JavaScript */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.3); /* Zachte, semitransparante donkere overlay */
    backdrop-filter: blur(4px);         /* Modern wazig achtergrondeffect */
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.2s ease-out;
}

/* Extra animatie voor het openen van de pop-up */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
