/* ============================================
   COMPARE PAGE SPECIFIC STYLES
   ============================================ */

:root {
    --noir: #0a0608;
    --charcoal: #14101a;
    --slate: #1c1624;
    --steel: #2d2438;
    --silver: #9a8fa8;
    --pearl: #f0eaf5;
    --ruby: #e31b54;
    --gold: #f5a623;
    --green: #22c55e;
    --font-body: 'Vazirmatn', 'Tajawal', 'Cairo', 'Noto Sans Arabic', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--noir);
    color: var(--pearl);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Background */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(107, 28, 58, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(45, 27, 78, 0.25) 0%, transparent 50%),
        var(--noir);
}

/* Compare Hero - Full Cover Under Menu */
.compare-hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 160px 20px 80px;
    margin-top: -120px;
    margin-left: -20px;
    margin-right: -20px;
    background: var(--charcoal);
    overflow: hidden;
}

.compare-hero__bg {
    position: absolute;
    inset: 0;
    background: url('https://image.tmdb.org/t/p/original/bQS43HSLZzMjZkcHJz4fGc7fNdz.jpg') center top / cover no-repeat;
    transform: scale(1.05);
    animation: coverZoom 30s ease-in-out infinite alternate;
}

@keyframes coverZoom {
    0% { transform: scale(1.05); }
    100% { transform: scale(1.15); }
}

.compare-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
        rgba(10,6,8,0.5) 0%, 
        rgba(10,6,8,0.8) 60%,
        var(--noir) 100%);
    z-index: 1;
}

.compare-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
    margin: 60px 0;
}

.compare-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, var(--ruby), var(--gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    color: #fff;
    box-shadow: 0 15px 50px rgba(227,27,84,0.4);
}

.compare-hero__title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.compare-hero__title span {
    background: linear-gradient(135deg, var(--ruby), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.compare-hero__desc {
    font-size: 1.2rem;
    color: var(--silver);
    max-width: 600px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .compare-hero {
        min-height: 350px;
        margin-left: -20px;
        margin-right: -20px;
        padding: 120px 20px 60px;
    }
    .compare-hero__title { font-size: 2.2rem; }
    .compare-hero__desc { font-size: 1rem; }
    .compare-icon { width: 80px; height: 80px; font-size: 2.2rem; }
}

/* Main Container */
.compare-container {
    padding: 40px 40px 60px;
}

/* Compare Grid */
.compare-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.compare-side {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 25px;
    min-height: 500px;
}

/* Search Box */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 14px 20px 14px 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--pearl);
    font-family: var(--font);
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--ruby);
}

.search-box input::placeholder {
    color: var(--silver);
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--silver);
}

/* Search Results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--charcoal);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-results.active {
    display: block;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.search-item img {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.search-item__info {
    flex: 1;
}

.search-item__title {
    font-size: 0.9rem;
    font-weight: 600;
}

.search-item__type {
    font-size: 0.75rem;
    color: var(--silver);
}

/* Selected Item */
.selected-item {
    text-align: center;
}

.selected-item__poster {
    width: 180px;
    height: 270px;
    margin: 0 auto 15px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.selected-item__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selected-item__title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.selected-item__type {
    display: inline-block;
    padding: 4px 12px;
    background: var(--ruby);
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.selected-item__clear {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--silver);
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.85rem;
    transition: all 0.3s;
}

.selected-item__clear:hover {
    border-color: var(--ruby);
    color: var(--ruby);
}

/* VS Circle */
.compare-vs {
    display: flex;
    align-items: center;
    justify-content: center;
}

.compare-vs__circle {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--ruby), var(--gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    box-shadow: 0 10px 40px rgba(227, 27, 84, 0.4);
}

/* Stats Table */
.stats-table {
    margin-top: 30px;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-label {
    text-align: center;
    color: var(--silver);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.stats-value {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.stats-value.winner {
    color: var(--green);
}

.stats-value.loser {
    color: var(--silver);
}

.stats-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.stats-bar__fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.stats-bar__fill--left {
    background: linear-gradient(90deg, var(--ruby), var(--gold));
    float: right;
}

.stats-bar__fill--right {
    background: linear-gradient(90deg, var(--gold), var(--ruby));
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--silver);
}

.empty-state i {
    font-size: 50px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
}

/* Loading State */
.loading-state {
    display: none;
    text-align: center;
    padding: 30px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--ruby);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 900px) {
    .compare-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .compare-vs {
        padding: 20px 0;
    }
    
    .compare-vs__circle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .compare-container {
        padding: 100px 20px 40px;
    }
    
    .compare-header__title {
        font-size: 1.7rem;
    }
}
