/* ✅ General Styles */
body {
    font-family: Arial, sans-serif;
    background-color: #181818;
    color: #ffffff;
    text-align: center;
    margin: 0;
    padding: 0;
}

header {
    padding: 15px;
    background: linear-gradient(to right, black, darkred);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.search-bar {
    display: flex;
    align-items: center;
}

.search-bar input {
    padding: 8px;
    font-size: 14px;
    border: none;
    border-radius: 5px;
    width: 200px;
    outline: none;
}

.search-bar button {
    background: red;
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.search-bar button:hover {
    background: darkred;
}

/* ✅ Video Container */
.video-container {
    margin: 10px auto;
    max-width: 900px;
    width: 100%;
    position: relative;
}

/* ✅ Responsive Iframe */
iframe {
    width: 100%;
    height: 55vw; /* Maintain Aspect Ratio */
    max-height: 500px;
    border: none;
    border-radius: 10px;
    background: #000;
}

/* ✅ Custom Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    gap: 5px;
}

/* ✅ Player Controls Layout */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 10px;
    gap: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 0, 0, 0.2);
}

.control-group {
    position: relative;
    display: flex;
    align-items: center;
}

.server-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #ff4d4d;
}

#serverSelect {
    padding: 8px 10px 8px 35px;
    background: #111;
    color: white;
    border: 1px solid #444;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

#serverSelect:hover {
    border-color: #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

/* ✅ Audio Switcher Premium Styles */
.audio-switcher {
    position: relative;
}

.premium-btn {
    background: linear-gradient(135deg, #8b0000, #ff0000);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.premium-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5);
    filter: brightness(1.2);
}

.premium-btn:active {
    transform: translateY(0);
}

.glass-dropdown {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    width: 160px;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 10px;
    padding: 8px 0;
    display: none;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.3s ease-out;
}

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

.glass-dropdown.show {
    display: flex;
}

.audio-option {
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #ccc;
}

.audio-option:hover {
    background: rgba(255, 0, 0, 0.1);
    color: white;
    padding-left: 20px;
}

.audio-option.active {
    background: linear-gradient(to right, rgba(255, 0, 0, 0.2), transparent);
    color: #ff4d4d;
    font-weight: bold;
    border-left: 3px solid #ff0000;
}

/* ✅ Navigation Controls */
.navigation-controls {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.navigation-controls button {
    background: #222;
    border: 1px solid #444;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.navigation-controls button:hover {
    background: #ff0000;
    border-color: #ff0000;
    transform: scale(1.1);
}

/* ✅ Loading Animation */
.video-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 10px;
}

.video-loader.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #222;
    border-top: 5px solid #ff0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 🔻 Red Line Decoration */
.season-line {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #ff0000, #cc0000);
    border-radius: 2px;
    box-shadow: 0px 2px 10px rgba(255, 0, 0, 0.5);
    margin-bottom: 10px;
}

/* 🔴 Red Dropdown Styling */
.season-dropdown {
    padding: 12px 15px;
    background: #1c1c1c;
    color: white;
    border: 2px solid #ff0000;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease-in-out;
    box-shadow: 0px 2px 8px rgba(255, 0, 0, 0.3);
    width: 100%;
    max-width: 140px;
    display: block;
}

/* ✅ Responsive Controls for Mobile */
@media (max-width: 600px) {
    .player-controls {
        flex-direction: row;
        flex-wrap: nowrap; /* Prevent immediate wrapping */
        gap: 5px; /* Reduce gap on small screens */
        justify-content: center;
        padding: 5px; /* Reduce padding on small screens */
    }
    
    .control-group, .audio-switcher, .navigation-controls {
        width: auto;
        justify-content: center;
        flex-shrink: 0; /* Prevent items from shrinking */
    }

    /* Shrink controls for small screens */
    #serverSelect {
        padding: 5px 5px 5px 25px; /* Smaller padding */
        font-size: 12px; /* Smaller font */
    }

    .premium-btn {
        padding: 5px 8px; /* Smaller padding */
        font-size: 12px; /* Smaller font */
        gap: 4px;
    }

    .navigation-controls button {
        width: 30px; /* Smaller buttons */
        height: 30px;
        font-size: 12px;
    }

    .glass-dropdown {
        left: 50%;
        transform: translateX(-50%);
        bottom: calc(100% + 15px);
    }
    
    @keyframes slideUp {
        from { opacity: 0; transform: translate(-50%, 10px); }
        to { opacity: 1; transform: translate(-50%, 0); }
    }
}

/* ✅ Buttons & Inputs */
button, select, input {
    padding: 8px;
    font-size: 14px;
    border-radius: 5px;
    border: none;
    background: red;
    color: white;
    cursor: pointer;
}

button:hover {
    background: #444;
}

.episode-container {
    margin-top: 15px;
}

/* ✅ Episode List */
.episodes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* ✅ Episode Cards */
.episode-card {
    background: #222;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
}

.episode-card:hover {
    background: #444;
}

/* ✅ Mobile Friendly Episode Cards */
@media (max-width: 600px) {
    .controls {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        padding: 10px;
        background-color: red;
        flex-wrap: nowrap;
        flex-direction: row;
    }
    
    .controls button,
    .controls select {
        padding: 10px;
        font-size: 14px;
        border: none;
        border-radius: 5px;
        background: white;
        color: black;
        flex-shrink: 0;
    }
    
    .controls select {
        width: auto;
        min-width: 100px;
    }

    .episode-card {
        width: 90%;
        padding: 12px;
        font-size: 16px;
    }
}

/* ✅ Remove Mobile Right Side Overflow */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    overflow-x: hidden;
    width: 100%;
}

/* ✅ Center Logo in Mobile View */
@media (max-width: 768px) {
    header {
        display: flex;
        justify-content: center; /* Centers everything inside the header */
        align-items: center;
        text-align: center;
    }

    .logo {
        height: 70px;
        max-width: 100%;
    }

.controls {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        padding: 10px;
        background-color: red;
        flex-wrap: nowrap;
        flex-direction: row;
    }
    
    .controls button,
    .controls select {
        padding: 10px;
        font-size: 14px;
        border: none;
        border-radius: 5px;
        background: white;
        color: black;
        flex-shrink: 0;
    }
    
    .controls select {
        width: auto;
        min-width: 100px;
    }

    @media (max-width: 400px) {
        .controls {
            flex-wrap: wrap; /* agar bahut chhoti screen ho toh wrap kar sake */
        }
    
        .controls button,
        .controls select {
            flex: 1 1 auto;
        }
    }    
}
