/* =====================================================
   TurkSeries - Premium Feminine Rose Gold Theme
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;900&display=swap');

:root {
    --rose: #E91E8C;
    --rose-light: #f472b6;
    --rose-pale: #fce7f3;
    --mauve: #9b4dca;
    --mauve-light: #c084fc;
    --gold: #f59e0b;
    --bg-dark: #0d0010;
    --bg-card: rgba(255, 255, 255, 0.06);
    --bg-card-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #fdf4ff;
    --text-secondary: rgba(253, 244, 255, 0.6);
    --border: rgba(255, 255, 255, 0.12);
    --shadow-glow: 0 0 30px rgba(233, 30, 140, 0.25);
    --gradient-bg: linear-gradient(135deg, #0d0010 0%, #1a0026 50%, #0d001a 100%);
    --gradient-rose: linear-gradient(135deg, #E91E8C, #9b4dca);
    --gradient-card: linear-gradient(180deg, rgba(233, 30, 140, 0.08) 0%, transparent 100%);
    --radius: 18px;
    --radius-sm: 10px;
    --font: 'Tajawal', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
    font-family: var(--font);
    background: var(--gradient-bg);
    color: var(--text-primary);
    direction: rtl;
    overflow-x: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(233, 30, 140, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(155, 77, 202, 0.12) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 12px 80px;
    min-height: 100vh;
}

/* =================== HEADER =================== */
.header {
    text-align: center;
    padding: 28px 16px 20px;
    position: relative;
}

.header::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--gradient-rose);
    border-radius: 2px;
    margin: 10px auto 0;
}

.header h1 {
    font-size: 26px;
    font-weight: 900;
    background: var(--gradient-rose);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header .subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 300;
}

/* =================== LOADING =================== */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 15px;
}

.loading::before {
    content: '';
    display: block;
    width: 44px;
    height: 44px;
    margin: 0 auto 20px;
    border: 3px solid var(--border);
    border-top-color: var(--rose);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =================== SERIES GRID =================== */
.series-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 8px 0;
}

/* =================== SERIES CARD =================== */
.series-card {
    display: block;
    text-decoration: none;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
}

.series-card:active {
    transform: scale(0.96);
}

.series-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-glow);
    border-color: rgba(233, 30, 140, 0.4);
}

.series-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-card);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.series-card:hover::before {
    opacity: 1;
}

/* Cover image */
.series-cover {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #1a0026, #33004d);
    color: transparent;
    transition: transform 0.4s ease;
}

.series-card:hover .series-cover {
    transform: scale(1.04);
}

/* Info overlay */
.series-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(13, 0, 16, 0.95) 0%, rgba(13, 0, 16, 0.7) 60%, transparent 100%);
    padding: 40px 12px 12px;
    z-index: 2;
}

.series-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.series-meta {
    font-size: 11px;
    color: var(--rose-light);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.series-meta::before {
    content: '▶';
    font-size: 8px;
    opacity: 0.8;
}

/* =================== SERIES DETAILS PAGE =================== */
.details-cover {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 0 0 28px 28px;
    display: block;
}

.details-body {
    padding: 20px 16px;
}

.details-title {
    font-size: 22px;
    font-weight: 900;
    background: var(--gradient-rose);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    line-height: 1.3;
}

.details-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    font-weight: 300;
    margin-bottom: 24px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.episodes-section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.episodes-section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: var(--gradient-rose);
    border-radius: 2px;
}

/* =================== EPISODES LIST =================== */
.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.episode-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.episode-item:active {
    transform: scale(0.98);
    border-color: var(--rose);
    background: rgba(233, 30, 140, 0.12);
}

.episode-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(233, 30, 140, 0.35);
    transform: translateX(-4px);
    box-shadow: 0 4px 20px rgba(233, 30, 140, 0.15);
}

.episode-title {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    line-clamp: 1;
}

.play-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    background: var(--gradient-rose);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    position: relative;
}

.play-icon::after {
    content: '';
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 11px solid white;
    position: absolute;
    right: 10px;
}

/* =================== WATCH PAGE =================== */
.watch-header {
    background: rgba(13, 0, 16, 0.95);
    backdrop-filter: blur(16px);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.watch-header-text {
    flex: 1;
}

.watch-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    line-clamp: 1;
}

.watch-header p {
    font-size: 12px;
    color: var(--rose-light);
    margin-top: 2px;
}

.player-container {
    width: 100%;
    background: #000;
    position: relative;
}

.player-iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    display: block;
}

/* =================== SERVER SELECTOR =================== */
.server-selector {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: rgba(13, 0, 16, 0.6);
    border-bottom: 1px solid var(--border);
}

.server-selector::-webkit-scrollbar {
    display: none;
}

.server-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 24px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.server-btn.active {
    background: var(--gradient-rose);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(233, 30, 140, 0.4);
}

.server-btn:active {
    transform: scale(0.95);
}

/* =================== BACK BUTTON =================== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--rose-light);
    font-size: 14px;
    font-family: var(--font);
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 12px;
    text-decoration: none;
    background: none;
    border: none;
    transition: color 0.2s;
}

.back-btn:active {
    color: var(--rose);
}

/* =================== EMPTY STATE =================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .icon {
    font-size: 52px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 12px rgba(233, 30, 140, 0.4));
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* =================== BADGE =================== */
.badge {
    display: inline-block;
    background: var(--gradient-rose);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

/* =================== SCROLLBAR =================== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--rose);
    border-radius: 4px;
}

/* =================== ANIMATIONS =================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.series-card,
.episode-item {
    animation: fadeInUp 0.4s ease both;
}

.series-card:nth-child(odd) {
    animation-delay: 0.05s;
}

.series-card:nth-child(even) {
    animation-delay: 0.1s;
}