:root {
    --primary-yellow: #FFC107;
    /* CNP Yellow */
    --accent-white: #FFFFFF;
    --bg-dark: #000000;
    /* Pure Black */
    --bg-card: rgba(20, 20, 20, 0.8);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-main: #ffffff;
    --text-muted: #cccccc;

    --font-heading: 'Noto Serif SC', 'Sarabun', serif;
    --font-body: 'Sarabun', 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--primary-yellow), transparent);
    top: -100px;
    left: -100px;
    animation: float 10s ease-in-out infinite;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent-white), transparent);
    bottom: -50px;
    right: -50px;
    opacity: 0.1;
    animation: float 12s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(40px);
    }
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(10, 10, 18, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 193, 7, 0.5));
}

/*.logo i {
    font-size: 2.5rem;
    color: var(--primary-yellow);
    filter: drop-shadow(0 0 10px rgba(255, 193, 7, 0.5));
}*/

.logo h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--text-main);
    letter-spacing: 1px;
}

.logo p {
    font-size: 0.8rem;
    color: var(--primary-yellow);
    text-transform: uppercase;
    letter-spacing: 2px;
    background: white;
    color: black;
    padding: 2px 5px;
    border-radius: 2px;
    font-weight: bold;
}

/* Search Bar */
.search-container {
    position: relative;
    margin: 0 20px;
    flex: 1;
    max-width: 400px;
}

#searchInput {
    width: 100%;
    padding: 10px 15px 10px 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-main);
    font-family: var(--font-body);
    outline: none;
    transition: all 0.3s ease;
}

#searchInput:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-yellow);
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.2);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Navigation */
.day-nav {
    display: flex;
    gap: 10px;
}

.day-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.3s ease;
    font-weight: 600;
}

.day-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--accent-gold);
}

.day-btn.active {
    background: var(--primary-yellow);
    color: black;
    border-color: var(--primary-yellow);
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.4);
}

/* Mobile Nav */
.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
}

.mobile-day-selector {
    margin: 20px 0;
}

#mobileDaySelect {
    width: 100%;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.4);
}

/* Schedule Grid Overhaul */
.schedule-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    padding: 40px 0;
    justify-content: flex-start;
    /* Ensure items start from left */
}

/* Anime Card Overhaul */
.anime-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);

    /* Force size for horizontal flow */
    flex: 0 0 260px;
    max-width: 260px;

    /* Animation */
    animation: fadeInUp 0.5s ease backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.anime-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(255, 193, 7, 0.15);
    border-color: var(--primary-yellow);
    z-index: 10;
}

.anime-card:hover .card-image {
    transform: scale(1.1);
}

.card-image {
    width: 100%;
    height: 350px;
    /* Taller portrait look */
    object-fit: cover;
    position: relative;
    transition: transform 0.5s ease;
}

.card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, var(--bg-dark), transparent);
}

.card-content {
    padding: 15px;
    position: absolute;
    bottom: 0;
    width: 100%;
}

.card-time {
    display: inline-block;
    background: var(--primary-yellow);
    color: black;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.countdown-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #000;
    color: var(--primary-yellow);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    border: 1px solid var(--glass-border);
    z-index: 2;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.card-episode {
    color: var(--primary-yellow);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Footer */
footer {
    margin-top: auto;
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    background: linear-gradient(to top, rgba(255, 193, 7, 0.05), transparent);
}

/* Loading State */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: var(--primary-yellow);
    font-family: var(--font-heading);
    font-size: 1.5rem;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: block;
    }

    header .container {
        justify-content: center;
        text-align: center;
    }

    .logo {
        flex-direction: column;
        gap: 5px;
    }

    /* Mobile Adjustments */
    .schedule-grid {
        justify-content: center;
        /* Center cards on mobile */
        gap: 15px;
    }

    .anime-card {
        flex: 0 0 45%;
        /* 2 cards per row on mobile */
        max-width: 45%;
    }

    .card-image {
        height: 220px;
    }

    .card-title {
        font-size: 1rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .anime-card {
        flex: 0 0 100%;
        /* 1 card per row */
        max-width: 300px;
    }
}