/* public/style.css */

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

/* Fix overscroll white background on mobile */
html {
    background: linear-gradient(135deg, #1a1f28 0%, #2d3748 50%, #1a1f28 100%);
    background-attachment: fixed;
}

body {
    font-family: 'Segoe UI', 'Trebuchet MS', 'Arial', sans-serif;
    min-height: 100vh;
    color: #333;
    background: linear-gradient(135deg, #1a1f28 0%, #2d3748 50%, #1a1f28 100%);
    background-attachment: fixed;
}

/* Home Link Wrapper */
.home-link {
    text-decoration: none;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.home-link:hover {
    transform: scale(1.02);
}

.home-link:active {
    transform: scale(0.98);
}

/* Header */
h1 {
    text-align: center;
    font-size: 3.5rem;
    color: #ffeb3b;
    text-transform: uppercase;
    text-shadow:
        3px 3px 0px #000,
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 20px rgba(255, 235, 59, 0.5);
    margin-top: 30px;
    margin-bottom: 20px;
    letter-spacing: 2px;
    font-weight: 900;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        text-shadow:
            3px 3px 0px #000,
            -1px -1px 0 #000,
            1px -1px 0 #000,
            -1px 1px 0 #000,
            1px 1px 0 #000,
            0 0 20px rgba(255, 235, 59, 0.5);
    }

    to {
        text-shadow:
            3px 3px 0px #000,
            -1px -1px 0 #000,
            1px -1px 0 #000,
            -1px 1px 0 #000,
            1px 1px 0 #000,
            0 0 40px rgba(255, 235, 59, 0.8);
    }
}

/* Controls Section */
.controls-section {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* Search Container */
.search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
}

#searchBox {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 1.1rem;
    border: 2px solid rgba(255, 235, 59, 0.5);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#searchBox:focus {
    border-color: #ffeb3b;
    box-shadow: 0 6px 25px rgba(255, 235, 59, 0.4);
    transform: translateY(-2px);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    pointer-events: none;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.filter-btn {
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 235, 59, 0.5);
    color: #ffeb3b;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.filter-btn:hover {
    background: rgba(255, 235, 59, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 235, 59, 0.3);
}

.filter-btn.active {
    background: #ffeb3b;
    color: #1a1f28;
    border-color: #ffeb3b;
    box-shadow: 0 4px 20px rgba(255, 235, 59, 0.5);
}

.season-dropdown {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 235, 59, 0.5);
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    color: #1a1f28;
}

.season-dropdown:hover {
    border-color: #ffeb3b;
    box-shadow: 0 4px 15px rgba(255, 235, 59, 0.3);
}

/* Random Episode Button */
.random-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border: 2px solid #ff6b35;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

.random-btn:hover {
    background: linear-gradient(135deg, #f7931e, #ff6b35);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.6);
    animation: none;
}

.random-btn:active {
    transform: translateY(-1px) scale(1.02);
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(255, 107, 53, 0.7);
    }
}


/* Episode Counter */
.episode-counter {
    padding: 10px 25px;
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4);
}

#episodeCount {
    font-size: 1.3rem;
    margin-right: 5px;
}

/* Main Container */
#mainContainer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Loading & Error Messages */
.loading-message,
.error-message,
.no-results {
    color: white;
    font-size: 1.5em;
    text-align: center;
    padding: 40px;
    text-shadow: 1px 1px 3px black;
}

.error-message {
    color: #ff5252;
}

.no-results {
    color: #ffeb3b;
}

/* Season Section */
.season-section {
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.season-section:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 235, 59, 0.3);
}

/* Season Header */
.season-header {
    background: linear-gradient(135deg, #ffeb3b, #fdd835);
    padding: 20px 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    user-select: none;
}

.season-header:hover {
    background: linear-gradient(135deg, #fdd835, #ffeb3b);
    box-shadow: 0 4px 20px rgba(255, 235, 59, 0.4);
}

.season-header h2 {
    font-size: 2rem;
    color: #1a1f28;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.season-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.episode-count-badge {
    background: #d32f2f;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(211, 47, 47, 0.3);
}

.toggle-arrow {
    font-size: 1.5rem;
    color: #1a1f28;
    transition: transform 0.3s ease;
    font-weight: bold;
}

.season-section.collapsed .toggle-arrow {
    transform: rotate(-90deg);
}

.season-section.collapsed .video-list {
    display: none;
}

/* Video List Grid */
.video-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 30px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Video Item - TV Screen Frame */
.video-item {
    background-image: url('/back.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    width: 280px;
    height: 220px;
    position: relative;
    border: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    background-color: transparent;
    padding: 0;
    text-decoration: none;
    color: #000;
    transition: all 0.3s ease;
    justify-self: center;
}

.video-item:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 12px 30px rgba(255, 235, 59, 0.4);
    filter: brightness(1.1);
}

/* TV Screen Area */
.tile-screen-area {
    position: absolute;
    background: radial-gradient(circle, rgba(255, 250, 240, 1) 20%, rgba(200, 200, 180, 1) 100%);
    top: 13%;
    left: 10%;
    width: 80%;
    height: 75%;
    clip-path: polygon(10.8% 5%,
            93.9% 4.2%,
            94.9% 91.6%,
            11.3% 90.5%);
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    transition: all 0.3s ease;
}

.video-item:hover .tile-screen-area {
    background: radial-gradient(circle, rgba(255, 255, 255, 1) 20%, rgba(220, 220, 200, 1) 100%);
}

/* Episode Number Badge */
.ep-number {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: white;
    padding: 4px 10px;
    font-size: 0.85em;
    font-weight: bold;
    border-radius: 4px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.4);
    transition: all 0.3s ease;
}

.video-item:hover .ep-number {
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.6);
    transform: scale(1.05);
}

/* Episode Title */
.ep-title {
    font-size: 1em;
    margin: 8px 8px;
    font-weight: bold;
    line-height: 1.2;
    color: #1a1f28;
    transition: all 0.3s ease;
}

.video-item:hover .ep-title {
    color: #d32f2f;
}

/* Episode Metadata */
.ep-meta {
    font-size: 0.7em;
    color: #666;
    border-top: 1px dotted #ccc;
    padding-top: 5px;
    margin-top: 5px;
    width: 100%;
}

/* Back Button (for watch.html) */
.back-btn {
    display: inline-block;
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.back-btn:hover {
    background: linear-gradient(135deg, #b71c1c, #d32f2f);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
        margin-top: 20px;
    }

    .controls-section {
        padding: 15px;
    }

    #searchBox {
        font-size: 1rem;
        padding: 12px 45px 12px 15px;
    }

    .filter-buttons {
        gap: 10px;
    }

    .filter-btn,
    .season-dropdown,
    .random-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }


    .season-header h2 {
        font-size: 1.5rem;
    }

    .video-list {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 25px;
    }

    .episode-counter {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }

    .season-header {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .season-header h2 {
        font-size: 1.2rem;
        flex: 1 1 100%;
    }
}