/* --- 1. ROOT VARIABLES & DESIGN TOKENS --- */
:root {
    --primary-gradient: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 100%);
    --bg-color: #FDFBF7;
    --user-msg-bg: #FFC3A0;
    --bot-msg-bg: #FFFFFF;
    --text-color: #4A4A4A;
    --accent-green: #40A41B;
    --font-main: 'Montserrat', sans-serif;
}

/* --- 2. GLOBAL RESET --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-main);
    position: relative;
    overflow: hidden; 
}

/* --- 3. BACKGROUND LAYER --- */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)), 
                      url('images/BG323245.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: blur(3px) brightness(1.1) contrast(0.9); 
    transform: scale(1.1);
    z-index: -1;
}

/* --- 4. NAVIGATION HEADER --- */
header, .chat-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 40px !important; 
    height: 100px !important;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100% !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.header-left, .header-right {
    flex: 1 1 0% !important;
    display: flex !important;
    align-items: center !important;
}

.header-left { justify-content: flex-start !important; gap: 15px; }
.header-right { justify-content: flex-end !important; gap: 15px; }

.header-center {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
}

.main-logo {
    height: 55px !important;
    width: auto !important;
    transition: 0.3s;
}

.subtitle {
    font-size: 10px !important;
    letter-spacing: 2px !important;
    margin-top: 4px !important;
    text-transform: uppercase;
    color: #888;
}

/* --- 5. BUTTONS & INTERACTION --- */
.button-group {
    display: flex;
    gap: 10px;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    min-width: 40px;
    height: 40px;
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #40A41B;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.nav-btn:hover, .social-btn:hover {
    background: #d4af37;
    color: #ffffff;      
    border-color: #d4af37;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.nav-btn:active {
    transform: translateY(0);
    scale: 0.96;
}

.social-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #40A41B;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.social-icon img, .social-icon i {
    height: 22px;
    width: auto;
    color: #40A41B;
}

/* --- 6. CHAT INTERFACE --- */
.chat-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
    padding-top: 10px;
    padding-bottom: 10px;
    border: none !important;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease;
}

.bot-message {
    align-self: flex-start;
    background: var(--bot-msg-bg);
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-bottom-left-radius: 2px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #ffc3a0 0%, #ffafbd 100%);
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: 0 2px 8px rgba(255, 175, 189, 0.4);
}

/* --- 7. INPUT AREA --- */
.input-area {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 10;
    box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.05), 
                inset 0 15px 15px -15px rgba(0, 0, 0, 0.1);
}

#user-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 25px;
    outline: none;
    font-family: var(--font-main);
    font-size: 16px !important;
    transition: 0.3s;
}

#user-input:focus {
    border-color: var(--accent-green);
    background-color: #fafafa;
}

#send-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: var(--accent-green);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(150, 201, 61, 0.3);
}
#send-btn i {
    font-size: 20px; 
    color: white;
}

/* --- 8. MODAL & FAQ COMPONENTS --- */
.modal {
    display: none; 
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 25px;
    border-radius: 25px;
    width: 90%;
    max-width: 450px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    position: relative;
    border: 1px solid #d4af37;
}
.modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    color: #2d5a27;
    font-size: 22px;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}
.faq-list {
    overflow-y: auto; 
    padding-right: 10px;
    margin-top: 15px;
}

.faq-list::-webkit-scrollbar { width: 4px; }
.faq-list::-webkit-scrollbar-thumb { background: #d4af37; border-radius: 10px; }

details {
    background: #f9fbf9;
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #eee;
}

summary {
    font-weight: 600;
    cursor: pointer;
    color: #2d5a27;
    list-style: none;
}

details p {
    padding-top: 15px;
    padding-left: 10px;
    padding-bottom: 5px;
    color: #666;
    line-height: 1.6;
    font-size: 0.9rem;
}

.legal-notice {
    border-left: 3px solid #d4af37;
    background: #fdfbf7;
    margin-top: 20px;
}

/* --- 9. SECRET SCRATCH CARD --- */
.secret-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
    padding: 0 10px;
    background: transparent !important;
}

.secret-card-inner {
    width: 100%;
    max-width: 350px;
    background: linear-gradient(135deg, #4A5D4E 0%, #2D3A30 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    color: #f1f1f1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.scratch-wrapper {
    position: relative;
    width: 100%;
    height: auto !important; 
    min-height: 160px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #fdfbf7;
}

#scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
}

.secret-header {
    background: linear-gradient(to right, #E0E7E1 0%, #A3B1A6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 5px;
}

.secret-hint {
    font-size: 12px;
    color: #aebfb1; 
    margin-bottom: 12px;
    text-align: center;
    font-style: italic;
    opacity: 0.9;
}

.secret-content {
    padding: 25px 20px;
    height: auto;
    min-height: 160px; 
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    
    color: #4a3b2a; 
    font-family: 'Georgia', serif;
    font-size: 15px;
    line-height: 1.5;
    font-style: italic;
}

/* --- 10. ANIMATIONS & UTILS --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.fade-in {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.chat-disclaimer {
    padding: 10px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
}

.chat-disclaimer p {
    font-size: 10px;
    line-height: 1.4;
    color: #999;
    max-width: 600px;
    margin: 0 auto;
}

/* --- 11. RESPONSIVE DESIGN --- */
@media (max-width: 600px) {
    header, .chat-header {
        padding: 0 15px !important;
        height: 75px !important;
        padding-top: env(safe-area-inset-top) !important;
        height: calc(75px + env(safe-area-inset-top)) !important;
    }

    .header-left, .header-right {
        flex: 1 1 0% !important;
    }

    .header-center {
        flex: 0 0 auto !important;
        padding: 0 10px !important;
    }

    .main-logo { height: 28px !important; }
    .subtitle { font-size: 7px !important; }

    .nav-btn, .social-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        border-radius: 50% !important;
        padding: 0 !important;
    }
    
    .nav-btn span { display: none !important; }
    .nav-btn { gap: 0 !important; }
}