/*
Theme Name: Flixawy
Theme URI: https://example.com/
Author: Joe Zakaria
Author URI: https://example.com/
Description: قالب فليكساوي الاحترافي المظلم لعرض الأفلام مع دعم كامل لجميع مسارات التصنيفات (سنة الإصدار، الممثلين، المخرج، الكاتب، الدولة، اللغة، الأقسام) وصفحة 404 مخصصة.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: flixawy18
*/

:root {
    --bg-main: #07090e;
    --bg-card: #0d1117;
    --bg-header: #0a0d13;
    --accent-red: #e50914;
    --accent-pink: #ff2a55;
    --border-color: rgba(255, 42, 85, 0.2);
    --border-hover: rgba(255, 42, 85, 0.5);
    --text-primary: #ffffff;
    --text-secondary: #c9d1d9;
    --text-muted: #8b949e;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-secondary);
    direction: rtl;
    text-align: right;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--text-primary);
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.site-header {
    background: var(--bg-header);
    border-bottom: 1px solid #1a202c;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 800;
    color: #fff;
}

.site-logo .badge-18 {
    background: var(--accent-red);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.main-nav a {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.main-nav a:hover {
    color: #fff;
}

.header-search form {
    display: flex;
    align-items: center;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 20px;
    padding: 4px 12px;
}

.header-search input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    padding: 6px;
    font-size: 13px;
}

.header-search button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* Grid & Movies */
.archive-title {
    color: #fff;
    font-size: 20px;
    margin: 25px 0 15px;
    border-right: 4px solid var(--accent-red);
    padding-right: 10px;
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.movie-card {
    background: var(--bg-card);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    border: 1px solid #1a202c;
    transition: transform 0.2s, border-color 0.2s;
}

.movie-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-red);
}

.poster-wrap {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: #111;
}

.poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.badge-year {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0,0,0,0.75);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
}

.card-info {
    padding: 10px;
    text-align: center;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.card-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* Pagination */
.pagination-wrap {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    gap: 6px;
}

.pagination-wrap .page-numbers {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 4px;
    font-size: 13px;
}

.pagination-wrap .page-numbers.current {
    background: var(--accent-red);
    color: #fff;
    border-color: var(--accent-red);
}

/* Single Movie Page */
.player-container {
    background: #000;
    aspect-ratio: 16/9;
    width: 100%;
    max-width: 960px;
    margin: 25px auto 20px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid #222;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-container iframe,
.player-container video {
    width: 100%;
    height: 100%;
    border: none;
}

.player-servers {
    max-width: 960px;
    margin: 0 auto 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.server-btn {
    background: var(--accent-red);
    color: #fff;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
}

/* Meta Data Grid (تصميم بطاقات المعلومات) */
.movie-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    max-width: 960px;
    margin: 20px auto 40px;
}

.meta-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s;
}

.meta-box:hover {
    border-color: var(--border-hover);
}

.meta-title {
    color: var(--accent-pink);
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-values {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
}

.meta-values a {
    color: #58a6ff;
    text-decoration: none;
}

.meta-values a:hover {
    color: #fff;
    text-decoration: underline;
}

.movie-content {
    max-width: 960px;
    margin: 20px auto 40px;
    background: var(--bg-card);
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #1a202c;
    color: var(--text-secondary);
}

/* 404 Page */
.error-404-container {
    text-align: center;
    padding: 90px 20px;
    max-width: 650px;
    margin: 0 auto;
}

.error-code {
    font-size: 110px;
    font-weight: 900;
    color: var(--accent-red);
    line-height: 1;
    margin-bottom: 10px;
    text-shadow: 0 4px 20px rgba(229, 9, 20, 0.4);
}

.error-title {
    font-size: 26px;
    color: #fff;
    margin-bottom: 15px;
}

.error-desc {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 30px;
}

.btn-home {
    display: inline-block;
    background: var(--accent-red);
    color: #fff;
    padding: 10px 26px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.2s, transform 0.2s;
}

.btn-home:hover {
    background: #b20710;
    transform: scale(1.05);
}

/* Footer */
.site-footer {
    background: var(--bg-header);
    border-top: 1px solid #1a202c;
    padding: 30px 0;
    text-align: center;
    margin-top: 50px;
}

.footer-logo {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 13px;
}

/* أزرار وشارات TMDB و IMDb */
.player-servers {
    justify-content: space-between;
    align-items: center;
}

.external-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.15);
    background: #161b22;
    color: #fff;
    transition: all 0.2s ease;
}

.meta-badge:hover {
    transform: translateY(-2px);
    border-color: #fff;
}

.imdb-badge {
    border-color: rgba(245, 197, 24, 0.4);
}

.imdb-badge:hover {
    background: #f5c518;
    color: #000;
}

.tmdb-badge {
    border-color: rgba(1, 180, 228, 0.4);
}

.tmdb-badge:hover {
    background: #01b4e4;
    color: #fff;
}


/* زر البحث السحابي في الهيدر */
.header-actions {
    display: flex;
    align-items: center;
}

.cloud-search-trigger {
    background: #161b22;
    border: 1px solid rgba(255, 42, 85, 0.4);
    color: #fff;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.25s ease;
}

.cloud-search-trigger:hover {
    background: #ff2a55;
    border-color: #ff2a55;
    box-shadow: 0 0 15px rgba(255, 42, 85, 0.5);
    transform: translateY(-2px);
}

.cloud-search-trigger .cloud-symbol {
    font-size: 16px;
    color: #01b4e4;
}

.cloud-search-trigger:hover .cloud-symbol {
    color: #fff;
}

/* نافذة البحث السحابية المنبثقة (Modal) */
.cloud-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cloud-search-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.cloud-search-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 12, 0.85);
    backdrop-filter: blur(10px);
}

.cloud-search-box {
    position: relative;
    z-index: 2;
    background: #0d1117;
    border: 1px solid rgba(255, 42, 85, 0.4);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(229, 9, 20, 0.2);
    width: 90%;
    max-width: 650px;
    border-radius: 12px;
    padding: 30px;
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cloud-search-overlay.active .cloud-search-box {
    transform: translateY(0) scale(1);
}

.cloud-search-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.cloud-search-close:hover {
    color: #ff2a55;
}

.cloud-search-header {
    text-align: center;
    margin-bottom: 22px;
}

.cloud-search-header .cloud-icon {
    font-size: 40px;
    color: #01b4e4;
    display: inline-block;
    margin-bottom: 6px;
    animation: cloudFloat 3s ease-in-out infinite;
}

@keyframes cloudFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.cloud-search-header h3 {
    color: #fff;
    font-size: 20px;
    margin-bottom: 4px;
}

.cloud-search-header p {
    color: #8b949e;
    font-size: 13px;
}

.cloud-input-wrap {
    display: flex;
    background: #161b22;
    border: 2px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cloud-input-wrap:focus-within {
    border-color: #ff2a55;
    box-shadow: 0 0 12px rgba(255, 42, 85, 0.4);
}

.cloud-input-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 14px 18px;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
}

.cloud-submit-btn {
    background: #e50914;
    color: #fff;
    border: none;
    padding: 0 24px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.cloud-submit-btn:hover {
    background: #b20710;
}


/* تنسيقات سيرفرات المشاهدة المتعددة */
.server-tabs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.server-btn {
    background: #161b22;
    color: #c9d1d9;
    border: 1px solid #30363d;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.server-btn .srv-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6e7681;
}

.server-btn:hover {
    background: #21262d;
    color: #fff;
    border-color: #ff2a55;
}

.server-btn.active {
    background: var(--accent-red);
    color: #fff;
    border-color: var(--accent-red);
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.4);
}

.server-btn.active .srv-dot {
    background: #fff;
}

/* طبقة صورة الغلاف للمشغل وزر التشغيل */
.player-container {
    position: relative;
    background: #000;
}

.player-poster-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.poster-gradient-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(7, 9, 14, 0.4) 0%, rgba(7, 9, 14, 0.85) 100%);
}

.play-action-btn {
    position: relative;
    z-index: 2;
    width: 80px;
    height: 80px;
    background: rgba(229, 9, 20, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(229, 9, 20, 0.6);
    transition: transform 0.25s ease, background 0.25s ease;
}

.player-poster-overlay:hover .play-action-btn {
    transform: scale(1.15);
    background: #ff2a55;
    box-shadow: 0 0 40px rgba(255, 42, 85, 0.8);
}

.play-action-btn svg {
    margin-right: -4px; /* لضبط التوسيط البصري لمثلث التشغيل */
}

.poster-title-tag {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-top: 18px;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* شاشات السيرفرات المتعددة */
.player-iframe-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.server-stream-item {
    display: none;
    width: 100%;
    height: 100%;
}

.server-stream-item.active {
    display: block;
}

.server-stream-item iframe,
.server-stream-item video {
    width: 100%;
    height: 100%;
    border: none;
}

.no-stream-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #8b949e;
    font-size: 14px;
}
