/* Import Google Fonts - Nunito for child-friendly, readable typography */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap');

/* CSS Variables - Nick Jr Inspired Color Palette */
:root {
    --primary-color: #0066CC;    /* Bright Nick Jr Blue */
    --secondary-color: #FF6600;  /* Orange */
    --accent-color: #FFD700;     /* Yellow */
    --success-color: #00AA44;    /* Green */
    --bg-color: #F0F8FF;         /* Alice Blue (softer than white) */
    --card-bg: #FFFFFF;          /* Clean White */
    --text-main: #2D3748;        /* Dark Grey for readability */
    --text-light: #718096;       /* Medium Grey */
    --border-color: #E2E8F0;     /* Light Border */
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-soft: rgba(0, 102, 204, 0.1); /* Blue-tinted shadow */
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-color);
    font-size: 16px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-main);
}

/* Header and navigation */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    transition: transform 0.2s ease, padding 0.2s ease;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    filter: brightness(0) invert(1);
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.accessibility-notes {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 0 1rem 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.accessibility-notes .note {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.header-hidden {
    transform: translateY(-100%);
}

.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 1rem;
    margin: 0;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    min-width: 60px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-icon {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.accessibility-controls {
    display: flex;
    gap: 0.5rem;
}

.accessibility-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

/* Screen-reader only helper */
.sr-only {
    border: 0 !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    -webkit-clip-path: inset(50%) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    width: 1px !important;
    white-space: nowrap !important;
}

.accessibility-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.mobile-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-color);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 10px var(--shadow);
    }

    .nav-list.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav-link {
        flex-direction: row;
        justify-content: flex-start;
        padding: 0.65rem;
        min-width: auto;
        font-size: 0.95rem;
    }

    .nav-icon {
        margin-bottom: 0;
        margin-right: 0.5rem;
        font-size: 1.1rem;
    }

    .header-container {
        padding: 0.5rem 0.75rem;
    }

    .accessibility-controls {
        gap: 0.25rem;
    }

    .accessibility-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .accessibility-notes {
        flex-direction: column;
        align-items: center;
        gap: 0.35rem;
        padding: 0 0.75rem 0.75rem;
        text-align: center;
    }
}

/* Accessibility Features */
body.focus-mode {
    background-color: #FFFFFF;
}

.focus-mode .hero,
.focus-mode .character-showcase,
.focus-mode .toy-chest-dock,
.focus-mode .magic-book-container {
    display: none !important;
}

.focus-mode main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px var(--shadow-soft);
}

.focus-mode h1, .focus-mode h2, .focus-mode h3 {
    color: var(--primary-color);
    text-align: center;
}

.focus-mode .btn, .focus-mode button {
    background: var(--primary-color);
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.focus-mode .btn:hover, .focus-mode button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px var(--shadow-soft);
}

/* Visual Schedule */
.visual-schedule-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 102, 204, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.5s ease;
}

.visual-schedule-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 1rem;
}

.schedule-header h3 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.5rem;
}

.close-schedule {
    background: var(--secondary-color);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.close-schedule:hover {
    transform: scale(1.1);
}

.schedule-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.schedule-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #F0F8FF;
    border-radius: 15px;
    border-left: 5px solid var(--primary-color);
    transition: all 0.3s ease;
}

.schedule-step.current {
    background: linear-gradient(135deg, var(--accent-color), var(--success-color));
    color: white;
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.schedule-step.current .step-number {
    background: white;
    color: var(--primary-color);
}

.step-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.step-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.step-text {
    font-weight: 600;
    line-height: 1.4;
}

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

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

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--shadow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Chat Interface */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
}

.chat-message {
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
    max-width: 70%;
    word-wrap: break-word;
    font-family: 'Nunito', sans-serif;
    line-height: 1.5;
}

.chat-message.user {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
    border-radius: 18px 18px 0 18px;
    box-shadow: 0 2px 10px rgba(108, 99, 255, 0.3);
}

.chat-message.ai {
    background: var(--card-bg);
    color: var(--text-main);
    margin-right: auto;
    border-radius: 18px 18px 18px 0;
    box-shadow: 0 2px 5px var(--shadow);
    border: 1px solid var(--border-color);
}

.chat-message .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Story Cards */
.story-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 8px 25px var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px var(--shadow);
}

.story-card h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.story-card p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-main);
}

/* Form Elements */
input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: var(--card-bg);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

/* Cards and Containers */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 15px var(--shadow);
    border: 1px solid var(--border-color);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Responsive design */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        margin: 0.5rem 0;
    }

    .chat-message {
        max-width: 85%;
    }

    .story-card {
        padding: 1.5rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    pointer-events: none;
}

.toast {
    background-color: #333;
    color: white;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    max-width: 300px;
    word-wrap: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: #4CAF50;
}

.toast.error {
    background-color: #f44336;
}

.toast.info {
    background-color: #2196F3;
}

.toast .close-btn {
    float: right;
    margin-left: 10px;
    cursor: pointer;
    font-weight: bold;
}

.disabled-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 768px) {
    .toast-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        max-width: none;
    }
}
