/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300;400;600;700&family=Nunito:wght@400;700;800&display=swap');

:root {
    /* Color Palette */
    --primary-blue: #4FACFE;
    --primary-dark-blue: #00f2fe;
    --accent-orange: #FF9966;
    --accent-yellow: #FFD700;
    --accent-green: #2ecc71;
    --bg-light: #F9FBFF;
    --text-dark: #2c3e50;
    --text-light: #ffffff;

    /* Spacing & Layout */
    --container-width: 1200px;
    /* Increased for modern screens */
    --header-height: 80px;
    --border-radius-lg: 25px;
    --border-radius-md: 15px;

    /* Shadows */
    --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: #F9FBFF url('../assets/img/arka%20plan.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-dark);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, 0.2) 100%),
        linear-gradient(to right, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, 0) 90%, rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
    z-index: -1;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Fredoka', sans-serif;
    color: var(--text-dark);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* --- Container --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
    /* Fixed padding */
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(15px);
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-right: 30px;
}

.logo {
    font-family: 'Fredoka', sans-serif;
    font-weight: 800;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1001;
    white-space: nowrap;
}

.logo-slogan {
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(0.6rem, 1.2vw, 0.75rem);
    color: var(--accent-orange);
    font-weight: 600;
    margin-top: -2px;
    white-space: nowrap;
}

.logo span {
    color: var(--primary-blue);
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    /* Force single line as requested */
    gap: clamp(5px, 0.8vw, 12px);
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: flex-start;
    /* Start from the left, after logo */
}

.nav-link {
    font-weight: 800;
    /* Extra bold for readability */
    font-size: clamp(0.8rem, 1.1vw, 0.95rem);
    /* Scaled down slightly for more fit */
    color: var(--text-dark);
    /* Darker text for white navbar */
    padding: 8px clamp(5px, 0.8vw, 12px);
    border-radius: 20px;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    display: inline-block;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-blue);
    background: rgba(79, 172, 254, 0.1);
    transform: translateY(-2px);
}

#nav-login-btn {
    padding: 8px 15px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    transition: all 0.3s ease;
    border-radius: 3px;
}

/* Responsive Navigation */
@media screen and (max-width: 992px) {

    /* Better threshold for laptop scaling */
    .menu-toggle {
        display: flex;
        margin-left: 20px;
        /* Space from logos */
    }

    .nav-content {
        justify-content: space-between;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 300px;
        /* Sidebar style on tablets/mobiles */
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 100px 30px;
        transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        gap: 15px;
        z-index: 1000;
        margin: 0;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-link {
        font-size: 1rem;
        width: 100%;
        padding: 15px;
        border-radius: 10px;
        text-align: center;
    }

    #nav-login-btn {
        width: 100%;
        padding: 15px;
        font-size: 1rem;
        text-align: center;
    }

    /* Hamburger Animation */
    .menu-toggle.is-active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.is-active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .menu-toggle.is-active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-blue), var(--primary-dark-blue));
    color: white;
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.6);
}

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

.btn-danger {
    background: #e74c3c;
    color: white !important;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.6);
}

/* --- Sections --- */
section {
    padding: 10px 0;
    min-height: auto;
}

.section-title {
    text-align: center;
    font-size: clamp(2.2rem, 8vw, 3.5rem);
    margin-bottom: 40px;
    color: #ffffff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
}

.section-title::after {
    content: '';
    display: block;
    width: 60%;
    height: 6px;
    background: var(--accent-orange);
    margin: 10px auto 0;
    border-radius: 10px;
}

/* --- Cards --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    /* Better fit for small screens */
    gap: 20px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--hover-shadow);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
}

.card h3 {
    margin-bottom: 10px;
    color: var(--text-dark);
}

.card p {
    color: #666;
    line-height: 1.6;
}

/* --- Badges --- */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-new {
    background: var(--accent-green);
    color: white;
}

/* --- Coloring Book & App View --- */
.coloring-card {
    cursor: pointer;
}

.coloring-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

#app-view {
    transition: opacity 0.3s ease;
    opacity: 0;
}

#app-view.active {
    opacity: 1;
}

/* --- Contest System Styles --- */
.contest-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    max-width: 800px;
    margin: 0 auto;
}

.center-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.highlight-icon {
    font-size: 5rem;
    color: var(--accent-yellow);
    margin-bottom: 20px;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 300px;
}

.btn-google {
    background: #db4437;
    color: white;
}

.btn-facebook {
    background: #4267B2;
    color: white;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.reward-card {
    background: linear-gradient(135deg, #FF9966, #FF5E62);
    padding: 15px;
    border-radius: 15px;
    color: white;
    text-align: center;
    width: 200px;
}

.reward-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: white;
    border-radius: 50%;
    margin: 10px 0;
}

.contest-actions {
    text-align: center;
    margin: 40px 0;
}

.pulse-anim {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(79, 172, 254, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(79, 172, 254, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(79, 172, 254, 0);
    }
}

.leaderboard {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 15px;
}

.leaderboard ul li {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.leaderboard ul li:last-child {
    border-bottom: none;
}

.rank {
    font-weight: bold;
    color: var(--primary-blue);
    width: 30px;
}

/* Quiz */
.quiz-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    font-size: 1.2rem;
    font-weight: bold;
}

.timer-box {
    background: var(--text-dark);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.option-btn {
    padding: 20px;
    border: 2px solid #eee;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--primary-blue);
    background: #f0f8ff;
}

.option-btn.correct {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
}

.option-btn.wrong {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.final-score-box {
    background: #f0f0f0;
    padding: 30px;
    border-radius: 50%;
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Ad Banner --- */
.ad-banner {
    position: fixed;
    left: 20px;
    bottom: 50px;
    z-index: 10;
    max-width: 180px;
    animation: float 6s ease-in-out infinite;
}

.ad-content {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 2px dashed #ddd;
    transition: all 0.3s ease;
}

.ad-content:hover {
    border-color: var(--primary-blue);
    transform: scale(1.02);
}

.ad-content img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 10px;
    display: block;
}

.ad-content p {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-dark);
    margin: 0;
}

@media (max-width: 768px) {
    .ad-banner {
        display: none;
        /* Hide on mobile to avoid clutter */
    }
}