/* QuestPlorer Kids Stories - Main Stylesheet */
:root {
    --primary-color: #8b46e7;     /* Purple */
    --secondary-color: #4ECDC4;   /* Turquoise */
    --accent-color: #FFD166;      /* Golden yellow */
    --text-color: #2C3E50;        /* Dark slate blue */
    --dark-bg: #1A2A3A;           /* Darker blue */
    --light-bg: #f8f6ff;          /* Light purple tint */
    --positive-color: #06D6A0;    /* Bright teal */
    --negative-color: #EF476F;    /* Bright pink */
    --info-color: #118AB2;        /* Ocean blue */
    --warning-color: #FFD166;     /* Golden yellow */
    --highlight-color: #EF476F;   /* Using negative color for highlights */
    --border-radius: 12px;        /* More rounded corners */
    --box-shadow: 0 8px 15px rgba(139, 70, 231, 0.1);
}

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Quicksand:wght@500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -moz-tap-highlight-color: transparent;
}

body {
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%238b46e7' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    font-family: 'Nunito', sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
.top-nav {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7438c8 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo a {
    font-size: 24px;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: .5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .2);
    background: linear-gradient(to right, #fff, #f5f5f5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: white;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    transition: transform 0.3s;
}

.logo:hover .logo-icon {
    transform: rotate(10deg);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s;
    position: relative;
    padding: 5px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background: var(--accent-color);
    bottom: 0;
    left: 0;
    border-radius: 10px;
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Header */
header {
    text-align: center;
    padding: 50px 0 30px;
    position: relative;
}

header h1 {
    font-size: 3rem;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-shadow: 2px 2px 0px rgba(139, 70, 231, 0.1);
    transform-style: preserve-3d;
    animation: float 5s ease-in-out infinite;
}

header p {
    font-size: 1.3rem;
    color: var(--text-color);
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.sparkle {
    display: inline-block;
    position: absolute;
    width: 15px;
    height: 15px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FFD166'%3E%3Cpath d='M12 1L9 9H1L7 14L5 22L12 17L19 22L17 14L23 9H15L12 1Z'/%3E%3C/svg%3E");
    background-size: contain;
    opacity: 0.8;
}

/* Book Sections */
.book-section {
    margin-bottom: 40px;
    padding: 30px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
}

.book-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
}

.book-section:hover {
    transform: translateY(-5px);
}

.book-section h2 {
    font-size: 2rem;
    font-family: 'Quicksand', sans-serif;
    color: var(--primary-color);
    margin-bottom: 25px;
    display: inline-block;
    position: relative;
}

.book-section h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-color);
    border-radius: 3px;
}

/* Chapter Cards */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.chapter-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: all 0.4s;
    position: relative;
    border: 3px solid transparent;
    opacity: 1;
}

.chapter-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: calc(var(--border-radius) - 3px) calc(var(--border-radius) - 3px) 0 0;
}

.chapter-content {
    padding: 20px;
}

.chapter-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-family: 'Quicksand', sans-serif;
}

.chapter-words {
    font-size: 1rem;
    color: var(--dark-bg);
    background-color: rgba(255, 209, 102, 0.2);
    padding: 8px 12px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
    margin-bottom: 15px;
}

.chapter-words span {
    color: var(--primary-color);
}

.view-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7438c8 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 4px 10px rgba(139, 70, 231, 0.3);
}

.view-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, #7438c8 0%, var(--primary-color) 100%);
    transition: width 0.3s;
    z-index: -1;
}

.view-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(139, 70, 231, 0.4);
}

.view-btn:hover::before {
    width: 100%;
}

/* Animation for empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin: 30px auto;
    max-width: 600px;
}

.empty-state img {
    width: 150px;
    margin-bottom: 20px;
    animation: bounce 2s ease infinite;
}

.empty-state h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-color);
    margin-bottom: 20px;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7438c8 100%);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%238b46e7' fill-opacity='1' d='M0,96L48,112C96,128,192,160,288,154.7C384,149,480,107,576,90.7C672,75,768,85,864,96C960,107,1056,117,1152,117.3C1248,117,1344,107,1392,101.3L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s;
}

footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0.2;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes wobble {
    0%, 100% { transform: translateY(0) rotate(1deg); }
    25% { transform: translateY(0) rotate(2deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(0) rotate(-1deg); }
}

.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

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

.chapter-card {
    opacity: 1;
    transform: translateY(0);
}

.book-section {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .chapter-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .book-section {
        padding: 20px;
    }
    
    .container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .chapter-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-container {
        flex-direction: column;
        padding: 10px;
    }
    
    .nav-links {
        margin-top: 15px;
    }
    
    .nav-links li {
        margin: 0 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .book-section h2 {
        font-size: 1.5rem;
    }
}
