:root {
    --primary: #33ff55;          /* Primary accent color (green) */
    --background: #0a0a0a;       /* Dark background */
    --surface: #151515;          /* Surface color for cards and modals */
    --text: #ffffff;             /* Primary text color */
    --text-secondary: #aaaaaa;   /* Secondary text color */
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 15px rgba(51, 255, 85, 0.4);
    text-decoration: none;
}

/* Search Bar Styles */
.search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background-color: #1D1D1D;
    padding: 0 15px;
    height: 50px;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(51, 255, 85, 0.2);
}

.search-container:focus-within .search-divider {
    background-color: var(--primary);
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    color: var(--text);
    font-size: 1rem;
    padding: 0 10px;
}

.search-input:focus {
    outline: none;
}

.search-divider {
    width: 3px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 0 12px;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
}

.search-button svg {
    width: 22px;
    height: 22px;
    stroke: var(--text-secondary);
    transition: all 0.3s ease;
}

.search-button:hover svg {
    stroke: #cccccc;
    transform: scale(1.1);
}

.search-button:active svg {
    transform: scale(0.95);
}

/* Settings Button Styles */
#settingsBtn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#settingsBtn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.settings-btn {
    width: 24px;
    height: 24px;
    stroke: var(--text-secondary);
    transition: transform 0.3s ease;
}

#settingsBtn:hover .settings-btn {
    stroke: var(--primary);
    transform: rotate(180deg);
}

/* Player Controls Styles */
.player-controls {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.play-next-btn {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.play-next-btn:disabled {
    background: #444;
    color: #777;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Content Section Styles */
.content-sections {
    margin: 3rem 0;
}

.section-title {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--primary);
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

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

.poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.8));
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: white;
}

.card:hover .card-overlay {
    opacity: 1;
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-type {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 0.5rem;
}

.rating, .year {
    font-size: 0.9rem;
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--primary);
    z-index: 1;
}

/* Error Message Styles */
.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4444;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    z-index: 1001;
}

.error-message.warning {
    background: #ffc107;
    color: #000;
}

/* Details Page Styles */
.details-page {
    display: none;
    margin-top: 2rem;
    position: relative;
}

.details-hero {
    position: relative;
    height: 50vh;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 2rem;
}

.details-hero .hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 2rem;
    color: white;
}

.details-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.details-hero p {
    font-size: 1.2rem;
    max-width: 800px;
}

.details-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.details-content .poster {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 8px;
}

/* Season Selector Styles */
.season-selector {
    position: relative;
    margin: 2rem 0;
}

.season-selector select {
    appearance: none;
    background: var(--surface);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    font-size: 1rem;
    color: var(--text);
    width: 100%;
    max-width: 300px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    transition: border-color 0.2s;
}

.season-selector select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Episode List Styles */
.episode-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.episode-still-container {
    position: relative;
}

.episode-card {
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.episode-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.episode-number {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.episode-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-still {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 6px 6px 0 0;
}

.episode-info {
    padding: 1rem;
}

.episode-card:hover {
    transform: translateY(-5px);
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    opacity: 0;
    transition: opacity 0.2s;
}

.episode-card:hover .play-overlay {
    opacity: 1;
}

.watch-btn {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.watch-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(51, 255, 85, 0.4);
}

/* Player Page Styles */
.player-page {
    display: none;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.player-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.player-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.back-btn {
    background: rgba(21, 21, 21, 0.8);
    color: var(--text);
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 20;
}

/* Hero Section Styles */
.hero-section {
    position: relative;
    height: 80vh;
    margin-bottom: 2rem;
    overflow: hidden;
}

.hero-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.5s ease-in-out;
    cursor: pointer;
}

.hero-card.fade {
    opacity: 0;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 2rem;
    color: white;
}

.hero-overlay h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-overlay p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    max-width: 600px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Text Anti-Scraping Styles */
.card-overlay p,
.hero-overlay p,
.episode-description {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.text-obfuscate span {
    display: inline-block;
    position: relative;
    transform: rotate(0.001deg);
}

.text-obfuscate span::after {
    content: "\200B"; /* Zero-width space */
    position: absolute;
    left: 0;
}

.text-obfuscate span.space {
    width: 0.3em;
    transform: none;
}

.text-obfuscate {
    white-space: pre-wrap;
    word-spacing: normal;
}

.noise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(255,255,255,0.02),
        rgba(255,255,255,0.02) 1px,
        transparent 1px,
        transparent 2px
    );
    mix-blend-mode: overlay;
}

/* Responsive Design */
@media (max-width: 768px) {
    .details-content {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    .details-content .poster {
        max-width: 220px;
        margin: 0 auto 2rem;
    }
    .episode-list {
        grid-template-columns: 1fr;
    }
    .back-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Settings Modal Styles */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.settings-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
}

.save-btn {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 1rem;
}
