/* =========================================
   Kids Hub Design System & Global Styles
   ========================================= */

:root {
    /* Fun, vibrant kid-friendly color palette */
    --primary-bg: #87CEEB; /* Sky blue */
    --gradient-bg: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 99%, #FECFEF 100%);
    --gradient-rich: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
    
    --color-yellow: #FFD166;
    --color-pink: #EF476F;
    --color-blue: #118AB2;
    --color-green: #06D6A0;
    --color-dark: #073B4C;
    --color-white: #FFFFFF;

    --text-main: #2C3E50;
    --text-light: #F8F9FA;
    
    --shadow-soft: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --shadow-hard: 4px 4px 0px rgba(0,0,0,0.1);
    
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 8px;
    
    --font-family: 'Baloo 2', cursive, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: var(--gradient-rich);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Typography styles */
h1, h2, h3, h4 {
    color: var(--color-dark);
    margin-bottom: 0.5em;
    font-weight: 700;
}

p { margin-bottom: 1em; }

/* === Utilities & Effects === */
.glass-header {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
}

.hidden {
    display: none !important;
}

/* === Layout & Structure === */
header .logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-pink);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 rgba(255,255,255,0.8);
}

header nav {
    display: flex;
    gap: 1rem;
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 100px);
}

/* === Buttons === */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

.nav-btn {
    background: transparent;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--color-yellow);
    box-shadow: var(--shadow-hard);
    color: var(--color-dark);
}

.primary-btn {
    background: var(--color-green);
    color: white;
    padding: 0.8rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 5px 0 #04a077;
    text-transform: uppercase;
}
.primary-btn:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 #04a077;
}

.close-btn {
    background: var(--color-pink);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 0 #bc2c4f;
}
.close-btn:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 #bc2c4f;
}

/* === Modals === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    border: 4px solid var(--color-blue);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 0.8rem;
    font-size: 1.1rem;
    border: 3px solid #ddd;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
}
.form-group input:focus, .form-group select:focus {
    border-color: var(--color-blue);
    outline: none;
}

/* === Chatbot Float & Window === */
.float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--color-pink);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 8px 0 #bc2c4f;
    z-index: 500;
}
.float-btn:active {
    transform: translateY(8px);
    box-shadow: 0 0 0 #bc2c4f;
}

#chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    display: flex;
    flex-direction: column;
    z-index: 499;
    border: 4px solid var(--color-pink);
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}
.chat-header {
    background: var(--color-pink);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-header h3 { color: white; margin: 0; }
.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #fdf2f8; /* very light pink */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
    animation: bounceIn 0.3s ease;
}
.message.bot { align-self: flex-start; }
.message.user { align-self: flex-end; }
.msg-bubble {
    padding: 0.8rem 1rem;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 500;
}
.message.bot .msg-bubble {
    background: white;
    border: 2px solid var(--color-pink);
    border-bottom-left-radius: 5px;
    color: var(--text-main);
}
.message.user .msg-bubble {
    background: var(--color-blue);
    color: white;
    border-bottom-right-radius: 5px;
}

.chat-input-area {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    background: white;
    border-top: 2px solid #eee;
}
.chat-input-area input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 20px;
    font-size: 1rem;
    font-family: inherit;
}
.chat-input-area input:focus {
    border-color: var(--color-pink);
    outline: none;
}
.chat-input-area button {
    background: var(--color-blue);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* === Animations === */
@keyframes slideDown { 0% { transform: translateY(-100%); } 100% { transform: translateY(0); } }
@keyframes fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes bounce { 
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes bounceIn {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.slide-down { animation: slideDown 0.5s ease-out; }
.fade-in { animation: fadeIn 0.5s ease-in; }
.bounce { animation: bounce 2s infinite; }
.bounce-in { animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.icon-bounce { animation: bounce 3s infinite; display: inline-block;}

/* Cards specific styling - will be used by JS injected views */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    cursor: pointer;
}
.glass-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}
.glass-card i {
    font-size: 4rem;
    margin-bottom: 1rem;
}
.glass-card.yellow i { color: var(--color-yellow); }
.glass-card.pink i { color: var(--color-pink); }
.glass-card.green i { color: var(--color-green); }
.glass-card.blue i { color: var(--color-blue); }

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* Media Queries for responsiveness */
@media (max-width: 768px) {
    header .logo { font-size: 1.5rem; }
    .nav-btn span { display: none; } /* hide text on mobile, keep icons */
    .nav-btn { font-size: 1.5rem; padding: 0.5rem; }
}
