/* ========================================
   OTANYUU - صفحة تفاصيل الأنمي المحسّنة
   ملف CSS موحد ومنظم - تم دمج جميع الأنماط
======================================== */

/* ===== متغيرات CSS العامة ===== */
:root {
    /* الألوان الأساسية */
    --primary-color: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    
    /* ألوان الحالة */
    --airing-color: #16a34a;
    --completed-color: #eab308;
    --movie-color: #333cff;
    --series-color: #8b5cf6;
    
    /* ألوان النصوص */
    --text-color: #f8f9fa;
    --text-muted: #94a3b8;
    --text-bright: #ffffff;
    
    /* ألوان الخلفيات */
    --bg-color: #121212;
    --card-bg: rgba(31, 31, 31, 0.8);
    --surface-bg: rgba(40, 40, 40, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);
    
    /* ألوان أخرى */
    --error-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    
    /* المسافات */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2.5rem;
    
    /* انحناء الحواف */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* الظلال */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* التحولات */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Base Styles ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

/* ===== Anime Header Section ===== */
.anime-header {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    background: linear-gradient(135deg, rgba(31, 31, 31, 0.95), rgba(25, 25, 25, 0.95));
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: fadeIn 0.5s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Create a subtle background pattern/effect */
.anime-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.15), transparent 70%);
    pointer-events: none;
}

/* ===== تحسينات متجاوبة للبوستر ===== */
@media (min-width: 1200px) {
    .anime-poster {
        flex: 0 0 380px;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .anime-poster {
        flex: 0 0 320px;
    }
}

.anime-poster {
    flex: 0 0 280px;
    position: relative;
    z-index: 1;
    perspective: 1000px;
    margin-right: calc(-1 * var(--spacing-md));
    transition: all var(--transition-normal);
}

.poster-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.anime-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translateZ(0);
    transition: all var(--transition-slow);
    border: 3px solid rgba(255, 255, 255, 0.1);
    display: block;
}

.poster-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 65%,
        rgba(0, 0, 0, 0.8) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--spacing-sm);
    opacity: 0.9;
    transition: opacity var(--transition-normal);
}

.anime-type-badge, .anime-status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    margin: var(--spacing-xs);
    transform: translateY(0);
    transition: all var(--transition-normal);
}

.anime-type-badge {
    align-self: flex-start;
    transform: translateY(-10px);
    opacity: 0.9;
}

.anime-status-badge {
    align-self: flex-end;
    margin-bottom: var(--spacing-md);
    transform: translateY(10px);
    opacity: 0.9;
}

.poster-wrapper:hover {
    transform: translateY(-5px) rotateY(5deg);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.poster-wrapper:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.poster-wrapper:hover .poster-overlay {
    opacity: 1;
}

.poster-wrapper:hover .anime-type-badge,
.poster-wrapper:hover .anime-status-badge {
    transform: translateY(0);
    opacity: 1;
}

.anime-poster::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 10%;
    width: 80%;
    height: 15px;
    background: rgba(0, 0, 0, 0.3);
    filter: blur(10px);
    border-radius: 50%;
    z-index: -1;
}

.anime-info {
    flex: 1;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1;
}

.anime-info h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-bright);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradient-slide 8s ease infinite;
}

.anime-info h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    border-radius: var(--radius-full);
}

.anime-rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.anime-rating .fa-star {
    color: #ffc107;
    margin-right: 5px;
}

.anime-rating .rating-value {
    font-weight: 700;
    transition: all 0.3s ease;
}

.anime-rating .rating-count {
    color: #7d7d7d;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.anime-rating .user-rating {
    background-color: rgba(124, 58, 237, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(124, 58, 237, 0.2);
    transition: all 0.3s ease;
}

.anime-rating .user-rating strong {
    color: #7c3aed;
    font-weight: 700;
}

/* Rating animation classes */
.rating-updated {
    animation: pulse 0.7s ease-in-out;
}

.badge-updated {
    animation: flash 0.7s ease-in-out;
}

.user-rating {
    display: inline-block;
    margin-right: 10px;
    padding: 0 8px;
    background-color: rgba(124, 58, 237, 0.1);
    border-radius: 4px;
    font-size: 0.85em;
    border-right: 2px solid #7c3aed;
}

.user-rating strong {
    color: #7c3aed;
    font-weight: 700;
}

.user-rating-updated {
    animation: highlight 0.7s ease-in-out;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #7c3aed; }
    100% { transform: scale(1); }
}

@keyframes flash {
    0% { background-color: rgba(124, 58, 237, 0.2); }
    50% { background-color: rgba(124, 58, 237, 0.5); }
    100% { background-color: rgba(124, 58, 237, 0.2); }
}

@keyframes highlight {
    0% { background-color: rgba(124, 58, 237, 0.1); }
    50% { background-color: rgba(124, 58, 237, 0.3); }
    100% { background-color: rgba(124, 58, 237, 0.1); }
}

/* Rating Dialog Styles */
.rating-popup {
    direction: rtl;
    font-family: 'Cairo', sans-serif;
    background: rgba(31, 31, 31, 0.95);
    color: #f8fafc;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rating-popup .swal2-title {
    color: white;
    font-size: 1.5rem;
}

.rating-stars {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.stars-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.stars-container i {
    font-size: 1.8rem;
    color: #ffc107;
}

.rating-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #7c3aed;
    margin-top: 10px;
}

.rating-tips {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-top: 10px;
    text-align: center;
}

.rating-description {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 15px;
    text-align: center;
    color: #ffc107;
}

input[type="range"].swal2-range {
    height: 10px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: all 0.3s;
}

input[type="range"].swal2-range::-webkit-slider-thumb {
    appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #7c3aed;
    cursor: pointer;
    transition: all 0.3s;
}

input[type="range"].swal2-range::-webkit-slider-thumb:hover {
    background: #6d28d9;
    transform: scale(1.1);
}

.rating-confirm-btn {
    background-color: #7c3aed !important;
    border-radius: 0.5rem !important;
}

.rating-cancel-btn {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
    border-radius: 0.5rem !important;
}

/* Rating Success Animation */
.rating-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
}

.rating-value-large {
    font-size: 3rem;
    font-weight: 700;
    color: #7c3aed;
    margin-bottom: 10px;
}

.rating-stars-large {
    font-size: 1.5rem;
    color: #ffc107;
    margin-bottom: 15px;
}

.btn-rate.rated {
    background-color: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.btn-rate.rated:hover {
    background-color: #7c3aed;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .anime-rating {
        font-size: 1rem;
    }
    
    .stars-container i {
        font-size: 1.5rem;
    }
    
    .rating-value {
        font-size: 1.8rem;
    }
    
    .rating-value-large {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .anime-rating {
        font-size: 0.9rem;
    }
    
    .stars-container i {
        font-size: 1.3rem;
    }
    
    .rating-value {
        font-size: 1.6rem;
    }
    
    .rating-value-large {
        font-size: 2.2rem;
    }
}

.anime-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.anime-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.anime-meta span:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.anime-meta i {
    font-size: 0.9rem;
}

.anime-status, .anime-type {
    font-weight: 600;
}

.description {
    background: rgba(0, 0, 0, 0.2);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    border-left: 4px solid var(--primary-color);
}

.description h2 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-bright);
}

.description p {
    color: var(--text-color);
    line-height: 1.7;
    font-size: 0.95rem;
}

.anime-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 0.95rem;
    border: none;
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.btn-favorite {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.4));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    height: 42px;
    min-width: 44px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.btn-favorite:hover {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.55));
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-favorite.is-favorite {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.18), rgba(255, 71, 87, 0.28));
    color: #ffdde0;
    border-color: rgba(255, 71, 87, 0.35);
    box-shadow: 0 6px 16px rgba(255, 71, 87, 0.25);
}

.btn-favorite.is-favorite:hover {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.28), rgba(255, 71, 87, 0.4));
    box-shadow: 0 14px 28px rgba(255, 71, 87, 0.35);
    border-color: rgba(255, 71, 87, 0.5);
}

.btn-favorite i {
    font-size: 1.15rem;
    transition: transform var(--transition-normal), color var(--transition-normal), text-shadow var(--transition-normal);
}

.btn-favorite:hover i {
    transform: translateY(-1px) scale(1.05);
}

.btn-favorite.is-favorite i {
    color: #ff4757;
    text-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
}

.btn-favorite:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15), 0 10px 22px rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.25);
}

@media (max-width: 576px) {
    .btn-favorite {
      height: 40px;
      padding: 0 12px;
    }
    .btn-favorite i {
      font-size: 1.1rem;
    }
}

.btn-rate {
    background: linear-gradient(135deg, #eab308, #f59e0b);
    color: white;
}

.btn-rate:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(234, 179, 8, 0.3);
}

/* ===== Episodes Section ===== */
.episodes-section {
    background: linear-gradient(135deg, rgba(31, 31, 31, 0.95), rgba(25, 25, 25, 0.95));
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.5s ease 0.2s both;
    position: relative;
    overflow: hidden;
}

.episodes-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.1), transparent 70%);
    pointer-events: none;
}

.episodes-section h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
    color: var(--text-bright);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--spacing-sm);
}

.episode-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    text-align: center;
    text-decoration: none;
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.episode-btn:hover, .episode-btn:focus-visible {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
    transform: translateY(-4px) scale(1.03);
}

.episode-btn.active {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: #ffffff;
    font-weight: 700;
    border-color: transparent;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.7), 0 0 20px rgba(124, 58, 237, 0.4);
    transform: translateY(-2px) scale(1.05);
}

.episode-details {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.episode-details h2 {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-md);
}

.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.1rem;
    margin-right: var(--spacing-md);
    text-decoration: none;
    min-width: 280px;
    min-height: 60px;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateZ(0);
    will-change: transform, box-shadow;
}

.link-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), transparent 50%);
    opacity: 0;
    transition: all 0.4s ease;
    transform: scale(0.8);
}

.link-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.link-btn:hover::before {
    opacity: 1;
    transform: scale(1);
}

.link-btn:hover::after {
    width: 300px;
    height: 300px;
}

.link-btn:active {
    transform: translateY(2px) scale(0.98);
    transition: all 0.1s ease;
}

.link-btn.watch {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8, #0284c7);
    background-size: 200% 200%;
    color: white;
    border-color: rgba(14, 165, 233, 0.3);
    animation: gradientShift 3s ease infinite;
}

.link-btn.watch:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(14, 165, 233, 0.4), 0 5px 15px rgba(14, 165, 233, 0.2);
    border-color: rgba(14, 165, 233, 0.6);
    background-position: 100% 100%;
}

.link-btn.watch:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.3), 0 15px 30px rgba(14, 165, 233, 0.4);
}

.link-btn.download {
    background: linear-gradient(135deg, #10b981, #34d399, #059669);
    background-size: 200% 200%;
    color: white;
    border-color: rgba(16, 185, 129, 0.3);
    animation: gradientShift 3s ease infinite;
}

.link-btn.download:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.4), 0 5px 15px rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.6);
    background-position: 100% 100%;
}

.link-btn.download:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3), 0 15px 30px rgba(16, 185, 129, 0.4);
}

/* Premium download button specific styles */
.link-btn.download.premium-download {
    background: linear-gradient(135deg, #10b981, #34d399, #059669);    background-size: 200% 200%;
    border-color: rgba(245, 158, 11, 0.3);
}

.link-btn.download.premium-download:hover {
    background: linear-gradient(135deg, #10b981, #34d399, #059669);    border-color: rgba(8, 224, 33, 0.6);
}


/* ===== Similar Animes Section ===== */
.similar-animes {
    background: linear-gradient(135deg, rgba(31, 31, 31, 0.95), rgba(25, 25, 25, 0.95));
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.5s ease 0.4s both;
    position: relative;
    overflow: hidden;
}

.similar-animes::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(139, 92, 246, 0.1), transparent 70%);
    pointer-events: none;
}

.similar-animes h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
    color: var(--text-bright);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--spacing-lg);
}

.similar-anime-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
   
    min-height: 100px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    position: relative;
}

.similar-anime-card::before {
    content: '';
    position: absolute;
   
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.similar-anime-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 5px 15px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
}

.similar-anime-card:hover::before {
    opacity: 1;
}

.similar-anime-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: all var(--transition-slow);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.similar-anime-card:hover img {
    transform: scale(1.08);
    filter: brightness(1.1) saturate(1.1);
}

.similar-anime-info {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.similar-anime-info h3 {
    font-size: 1rem;
    color: var(--text-bright);
    margin-bottom: var(--spacing-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.similar-anime-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.similar-type {
    background: rgba(139, 92, 246, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-color);
}

.similar-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.similar-rating i {
    color: #ffc107;
}

.btn-details {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    text-decoration: none;
    transition: all var(--transition-normal);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-details:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

/* ===== Utilities ===== */
.notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 100;
    border: none;
    backdrop-filter: blur(6px);
    background: rgba(124, 58, 237, 0.75);
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background: rgba(124, 58, 237, 0.95);
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.6);
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 992px) {
    .anime-header {
        flex-direction: column;
    }
    
    .anime-poster {
        flex: 0 0 auto;
        max-width: 250px;
        margin-right: 0;
        margin: 0 auto;
        margin-top: var(--spacing-lg);
    }
    
    .similar-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: var(--spacing-md);
    }
    
    .similar-anime-card {
        border-radius: var(--radius-md);
    }
    
    .similar-anime-card img {
        height: 170px;
    }
    
    .anime-info {
        padding-top: 0;
    }
}

@media (max-width: 768px) {
    .container {
        padding: var(--spacing-sm);
    }
    
    .anime-header {
        padding: var(--spacing-md);
    }
    
    .anime-info h1 {
        font-size: 1.6rem;
    }
    
    .anime-meta {
        gap: var(--spacing-sm);
    }
    
    .anime-meta span {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
    
    .similar-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .anime-actions {
        flex-direction: column;
    }
    
    .btn, .link-btn {
        width: 100%;
        min-width: 100%;
        justify-content: center;
        text-align: center;
    }
    
    .link-btn {
        min-height: 70px;
        padding: 1.3rem 1rem;
        font-size: 1rem;
    }
    
    .link-btn i {
        font-size: 1.15rem;
    }
    
    .download-text {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.25rem;
    }
    
    .download-text strong {
        font-size: 1rem;
        line-height: 1.2;
    }
    
    .download-text small {
        font-size: 0.85rem;
        opacity: 0.9;
        line-height: 1.1;
    }
}

@media (max-width: 576px) {
    .anime-info h1 {
        font-size: 1.4rem;
    }
    
    .anime-rating {
        font-size: 1rem;
    }
    
    .anime-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }
    
    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
    }
    
    .episode-btn {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    .similar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .similar-anime-card {
        min-height: 280px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        border-radius: var(--radius-md);
    }
    
    .similar-anime-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    }
    
    .similar-anime-card img {
        height: 150px;
    }
    
    .similar-anime-info {
        padding: 0.75rem;
    }
    
    .similar-anime-info h3 {
        font-size: 0.85rem;
        line-height: 1.2;
        -webkit-line-clamp: 2;
    }
    
    .similar-anime-meta {
        margin-bottom: 0.5rem;
    }
    
    .similar-type {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .similar-rating {
        font-size: 0.8rem;
    }
    
    .btn-details {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        border-radius: var(--radius-sm);
    }
    
    .link-btn {
        margin-right: 0;
        margin-bottom: var(--spacing-sm);
        min-width: 100%;
        padding: 1.3rem 1rem;
        font-size: 0.95rem;
        min-height: 70px;
    }
    
    .link-btn i {
        font-size: 1.1rem;
    }
    
    .episode-actions {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: stretch;
    }
    
    .episodes-section h2,
    .similar-animes h2 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .anime-info h1 {
        font-size: 1.3rem;
    }
    
    .episode-details {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .link-btn {
        margin-right: 0;
        margin-bottom: var(--spacing-sm);
        min-height: 75px;
        padding: 1.4rem 1rem;
        font-size: 0.9rem;
        gap: 0.5rem;
    }
    
    .episodes-section h2,
    .similar-animes h2 {
        font-size: 1.3rem;
    }
    
    .similar-anime-card img {
        height: 100px;
    }
    
    .anime-poster {
        max-width: 200px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== Comments Section ===== */
.comments-section {
    background: linear-gradient(135deg, rgba(31, 31, 31, 0.95), rgba(25, 25, 25, 0.95));
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.comments-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.15), transparent 70%);
    pointer-events: none;
}

.comments-section h2 {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
    color: var(--text-bright);
    position: relative;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comments-count {
    margin-right: var(--spacing-sm);
    background-color: var(--primary-color);
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    margin-right: 0;
    margin-left: var(--spacing-sm);
}

.comment-form {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-form:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
}

.comment-form textarea {
    width: 100%;
    min-height: 80px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    color: var(--text-color);
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    resize: vertical;
    transition: all var(--transition-normal);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--spacing-md);
}

.submit-comment {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
}

.submit-comment:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.submit-comment:disabled {
    background-color: #4b5563;
    cursor: not-allowed;
    transform: none;
}

/* Comments list styling */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.comment {
    display: flex;
    gap: var(--spacing-md);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.comment:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.user-level {
    background-color: #4a4a4a;
    color: #f0f0f0;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}

.comment-author {
    font-weight: bold;
    color: #f0f0f0;
    font-size: 0.9rem;
}

.comment-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Hijri date styling */
.comment-date {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-date::before {
    content: '\f017';
    font-family: 'Font Awesome 5 Free';
    font-weight: 400;
    font-size: 0.8rem;
    opacity: 0.7;
}

.comment-text {
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
    color: var(--text-color);
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-actions {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    flex-wrap: wrap;
    margin-top: var(--spacing-sm);
}

.comment-action {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all var(--transition-normal);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-md);
    font-family: 'Cairo', sans-serif;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.comment-action:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    transition: height 0.2s ease;
    z-index: -1;
}

.comment-action:hover:after {
    height: 100%;
}

.comment-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Like button styling */
.comment-action.like-action {
    color: var(--text-muted);
}

.comment-action.like-action:hover {
    color: #e11d48;
    border-color: rgba(225, 29, 72, 0.3);
}

.comment-action.liked {
    color: #e11d48;
    background-color: rgba(225, 29, 72, 0.1);
    border-color: rgba(225, 29, 72, 0.3);
}

.comment-action.liked i {
    color: #e11d48;
}

.like-count {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 1rem;
    text-align: center;
}

/* Reply button styling */
.comment-action.reply-action {
    color: var(--text-muted);
}

.comment-action.reply-action:hover {
    color: var(--primary-color);
    border-color: rgba(124, 58, 237, 0.3);
}

/* Delete button styling */
.comment-action.delete-action {
    color: var(--error-color);
    opacity: 0.7;
    background-color: rgba(239, 68, 68, 0.05);
    transition: all var(--transition-normal);
    margin-left: auto;
}

.comment-action.delete-action:hover {
    color: var(--error-color);
    opacity: 1;
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.comment:hover .delete-action, 
.reply:hover .delete-action {
    opacity: 1;
}

/* Delete confirmation modal override */
.swal2-popup.swal-danger-popup {
    background: rgba(31, 31, 31, 0.95);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--text-color);
}

.swal2-popup .swal2-title {
    color: var(--text-bright);
}

.swal2-popup .swal2-content {
    color: var(--text-muted);
}

.swal-danger-button {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
}

.swal-cancel-button {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-color) !important;
}

/* Animation for deleting comments */
@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); height: 0; margin: 0; padding: 0; border: none; }
}

.comment.deleting, 
.reply.deleting {
    animation: fadeOut 0.5s ease forwards;
    pointer-events: none;
}

/* Add visual feedback when a new comment is added */
.comment.new-comment {
    animation: highlight-comment 2s ease;
}

@keyframes highlight-comment {
    0% { background-color: rgba(124, 58, 237, 0.2); }
    70% { background-color: rgba(124, 58, 237, 0.2); }
    100% { background-color: rgba(255, 255, 255, 0.03); }
}

/* Reply styles */
.reply {
    display: flex;
    gap: var(--spacing-md);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-right: var(--spacing-lg);
    margin-top: var(--spacing-md);
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
}

/* Responsive adjustments for replies */
@media (max-width: 768px) {
    .reply {
        flex-direction: column;
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .reply {
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
    }
    .reply .comment-avatar {
        width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }
}

.reply:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.08);
}

.reply .comment-avatar {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

/* Reply form styling */
.reply-form {
    margin-top: var(--spacing-md);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.reply-form textarea {
    width: 100%;
    min-height: 60px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    color: var(--text-color);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    transition: all var(--transition-normal);
}

.reply-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.reply-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.submit-reply, .cancel-reply {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: 'Cairo', sans-serif;
}

.submit-reply {
    background-color: var(--primary-color);
    color: white;
}

.submit-reply:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.submit-reply:disabled {
    background-color: #4b5563;
    cursor: not-allowed;
    transform: none;
}

.cancel-reply {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.cancel-reply:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Loading states */
.comment-action.loading {
    pointer-events: none;
    opacity: 0.7;
}

.comment-action.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No comments message */
.no-comments {
    text-align: center;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1rem;
}

/* Loading spinner for comments */
.comments-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

.episode-nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    margin-top: var(--spacing-md);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-normal);
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.episode-nav-btn:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.prev-episode {
    float: right;
}

.next-episode {
    float: left;
}

.episode-nav-btn i {
    margin: 0 0.5rem;
}

/* وصف التقييم */
.rating-text-description {
    display: inline-block;
    margin-right: 10px;
    font-size: 0.85rem;
    border-radius: 4px;
    padding: 2px 8px;
    transition: all 0.3s ease;
}

/* ألوان مختلفة لمستويات التقييم */
.rating-excellent {
    background-color: rgba(0, 200, 83, 0.1);
    color: #00c853;
    border-right: 2px solid #00c853;
}

.rating-good {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border-right: 2px solid #ffc107;
}

.rating-average {
    background-color: rgba(255, 152, 0, 0.1);
    color: #ff9800;
    border-right: 2px solid #ff9800;
}

.rating-poor {
    background-color: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border-right: 2px solid #f44336;
}

/*
 * Comment Like Button CSS (v2 - Pseudo-element approach)
 * This is a cleaner method that avoids HTML repetition and is robust
 * against FontAwesome's SVG replacement scripts.
 */
.comment-actions .like-action {
    position: relative;
    padding-left: 28px; /* Make space for the icon */
}

.comment-actions .like-action::before {
    content: '\f004'; /* FontAwesome unicode for heart */
    font-family: 'Font Awesome 5 Free';
    font-weight: 400; /* Regular heart */
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #e53e3e; /* Red color for the heart */
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.comment-actions .like-action.liked::before {
    font-weight: 900; /* Solid heart */
    animation: like-pulse 0.3s ease-out;
}

.comment-actions .like-action:hover::before {
    transform: translateY(-50%) scale(1.2);
}

@keyframes like-pulse {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.3); }
    100% { transform: translateY(-50%) scale(1); }
}

.comment-author-link,
.comment-avatar-link {
    text-decoration: none;
    color: inherit;
    display: contents; /* This makes the <a> tag behave like its contents */
}

/* ====== Modern UI Extra Enhancements (2025) ====== */
@keyframes gradient-slide {
    0% {background-position: 0% 50%;}
    50% {background-position: 100% 50%;}
    100% {background-position: 0% 50%;}
}

.anime-info h1 {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradient-slide 8s ease infinite;
}

/* Episode buttons - enhanced hover & active states */
.episode-btn:hover, .episode-btn:focus-visible {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
    transform: translateY(-4px) scale(1.03);
}

.episode-btn.active {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: #ffffff;
    font-weight: 700;
    border-color: transparent;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.7), 0 0 20px rgba(124, 58, 237, 0.4);
    transform: translateY(-2px) scale(1.05);
}

/* Universal button & link ripple light effect */
.btn, .link-btn {
    position: relative;
    overflow: hidden; /* clip ripple */
}

.btn::after, .link-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.15), transparent 40%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after, .link-btn:hover::after {
    opacity: 1;
}

/* Back-to-top glassy look */
.back-to-top {
    backdrop-filter: blur(6px);
    background: rgba(124, 58, 237, 0.75);
}

.back-to-top:hover {
    background: rgba(124, 58, 237, 0.95);
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.6);
}

/* ====== Additional UI Polish (2025 v2) ====== */

/* Global text selection color */
::selection {
    background: var(--primary-color);
    color: #ffffff;
}

/* Poster reflection */
.poster-wrapper::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(0deg, rgba(255,255,255,0.06) 0%, transparent 100%);
    transform: scaleY(-1);
    filter: blur(8px);
    opacity: 0.5;
    pointer-events: none;
}

/* Badges subtle glow */
@keyframes badge-glow {
    0% { box-shadow: 0 0 4px 0 rgba(255,255,255,0.25); }
    50% { box-shadow: 0 0 12px 2px rgba(255,255,255,0.45); }
    100% { box-shadow: 0 0 4px 0 rgba(255,255,255,0.25); }
}

.anime-type-badge, .anime-status-badge {
    animation: badge-glow 3.5s ease-in-out infinite;
}

/* Meta icon interaction */
.anime-meta span i {
    transition: transform 0.6s cubic-bezier(.4,0,.2,1);
}

.anime-meta span:hover i {
    transform: rotate(360deg);
}

/* Similar anime cards entrance */
@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(25px); }
    100% { opacity: 1; transform: translateY(0); }
}

.similar-anime-card {
    animation: fadeUp 0.7s ease both;
}

.similar-anime-card:nth-child(2) { animation-delay: 0.1s; }
.similar-anime-card:nth-child(3) { animation-delay: 0.2s; }
.similar-anime-card:nth-child(4) { animation-delay: 0.3s; }

/* Button press feedback */
.btn:active, .link-btn:active {
    transform: scale(0.95);
}

/* Enhanced ripple expansion */
.btn:hover::after, .link-btn:hover::after {
    transform: scale(1.35);
}

/* === Responsive & Image Fixes (2025-07) === */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.poster-wrapper {
    aspect-ratio: 2 / 3;
}

.similar-animes .similar-anime-card img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

/* Poster & similar cards image fixes */

/* Consistent poster height on desktop */
@media (min-width: 992px) {
    .poster-wrapper {
        max-height: 480px;
    }
    .poster-wrapper img {
        height: 100%;
        width: auto;
    }
}

.poster-wrapper img,
.similar-anime-card img { /* keep images crisp */
    border-radius: var(--radius-md);
    transition: transform 0.4s cubic-bezier(.25,.8,.25,1), filter 0.4s ease;
}

.poster-wrapper:hover img,
.similar-anime-card:hover img {
    transform: translateY(-4px) scale(1.04);
    filter: brightness(1.08) saturate(1.1);
}

.poster-wrapper img,
.similar-animes .similar-anime-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Daily Reward SweetAlert2 Theme ===== */
.reward-popup {
  direction: rtl;
  background: rgba(31, 31, 31, 0.92);
  color: #f9fafb;
  border-radius: 1rem !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 10px 30px rgba(0,0,0,0.45), 0 0 20px rgba(124,58,237,0.35);
}

.reward-popup .swal2-title {
  font-size: 1.6rem !important;
  font-weight: 700;
  color: #fefefe;
}

.reward-popup .swal2-html-container {
  font-size: 1.05rem !important;
  color: #d1d5db;
  line-height: 1.6;
}

.reward-popup .swal2-confirm.swal2-styled {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
  padding: 0.7rem 1.7rem !important;
  font-weight: 700;
  border-radius: 0.625rem !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
  transition: transform 0.2s ease;
}

.reward-popup .swal2-confirm.swal2-styled:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(124,58,237,0.55);
}

.reward-popup .swal2-icon.swal2-success {
  border-color: rgba(124, 58, 237, 0.4) !important;
}
.reward-popup .swal2-success-line-long,
.reward-popup .swal2-success-line-tip {
  background-color: #8b5cf6 !important;
}

@media (max-width: 480px) {
  .reward-popup {
    width: 90% !important;
  }
}

/* Stack header on small screens */
@media (max-width: 768px) {
    .anime-header {
        flex-direction: column;
        align-items: center;
    }
    .anime-poster {
        flex: 0 0 auto;
        width: 60%;
        max-width: 260px;
        margin-right: 0;
        margin-bottom: var(--spacing-lg);
    }
}