:root {
    --primary: #e50914;
    --primary-dark: #b2070f;
    --secondary: #1a1a1a;
    --accent: #ff8a00;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --bg-dark: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-hover: #2a2a2a;
    --border: #333333;
    --success: #4CAF50;
    --warning: #ff9800;
    --error: #f44336;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    --radius: 8px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--secondary), #000);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

@media (min-width: 768px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 40px;
    width: auto;
    transition: var(--transition);
}

.logo-img:hover {
    transform: scale(1.05);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
}

.search-container {
    flex: 1;
}

.search-form {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.search-form:focus-within {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px var(--primary);
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

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

.search-button {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.search-button:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-1px);
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 2rem 0;
}

@media (min-width: 1024px) {
    .main-content {
        flex-direction: row;
    }
}

.content-area {
    flex: 1;
}

/* Section Headers */
.section-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Drama Grid */
.drama-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .drama-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .drama-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.drama-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border);
    cursor: pointer;
}

.drama-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
    border-color: var(--primary);
}

.drama-image {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 150%;
    overflow: hidden;
}

.drama-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.drama-card:hover .drama-image img {
    transform: scale(1.05);
}

.drama-info {
    padding: 1rem;
}

.drama-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    height: 2.6em;
    color: var(--text-primary);
}

.drama-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.drama-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tag {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid var(--border);
    min-width: 44px;
}

.pagination a:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.pagination .active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: var(--shadow);
}

/* Stats */
.stats {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.stats a {
    color: var(--primary);
    text-decoration: none;
    margin-left: 0.5rem;
    transition: var(--transition);
}

.stats a:hover {
    color: var(--accent);
}

/* Error & No Results */
.error-message,
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin: 2rem 0;
    border: 1px solid var(--border);
}

.error-message {
    color: var(--error);
}

.no-results {
    color: var(--text-muted);
}

.no-results h2 {
    font-size: 2em;
    margin-bottom: 1rem;
}

.no-results a {
    color: var(--primary);
    text-decoration: none;
}

.no-results a:hover {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .drama-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--secondary), #000);
    color: var(--text-secondary);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-section h3 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section p {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.footer-bottom a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: var(--accent);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--secondary), #000);
    color: var(--text-secondary);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

.footer-bottom a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}
