:root {
    --primary-color: #ef4444;
    --bg-dark: #111827;
    --bg-darker: #1f2937;
    --text-light: #ffffff;
    --text-gray: #9ca3af;    
}

/* الخطوط واللون */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease; /* تأثير ناعم عند تغيير اللون أو الخلفية */
    margin: 0;
}


/* احا */

/* Navigation */
.navbar {
    background-color: var(--bg-darker);
    position: fixed;
    width: 100%;
    z-index: 1000;
    top: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar:hover {
    background-color: #2a3651;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    font-size: 1.25rem;
    user-select: none;
    transition: color 0.3s ease;
}

.logo:hover {
    color: var(--primary-color);
    cursor: pointer;
}

.logo-icon {
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.logo-icon:hover {
    transform: rotate(15deg);
}

.search-bar {
    position: relative;
    max-width: 32rem;
    flex: 1;
    margin: 0 1rem;
}

.search-bar input {
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    background-color: #374151;
    border: none;
    border-radius: 0.5rem;
    color: var(--text-light);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.search-bar input:hover {
    background-color: #4b5563;
}

.search-bar input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    box-shadow: 0 0 8px var(--primary-color);
}

.search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    transition: color 0.3s ease;
}

.search-bar input:focus + .search-icon {
    color: var(--primary-color);
}

.nav-buttons {
    display: flex;
    gap: 1rem;
}

.icon-button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.icon-button a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.icon-button:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Hero Section */
.hero {
    position: relative;
    height: 60vh;
    background: linear-gradient(to bottom, transparent, var(--bg-dark));
    margin-top: 5rem;
    overflow: hidden;
}

.slideshow {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 0;
    transition: opacity 1s ease-in-out, z-index 0s 1s;
    will-change: opacity;
}

.hero-image.active {
    opacity: 1;
    z-index: 1;
    transition: opacity 1s ease-in-out, z-index 0s 0s;
}

.hero-content {
    position: absolute;
    bottom: 10%;
    left: 5%;
    max-width: 400px;
    color: var(--text-light);
    z-index: 2;
    animation: slideUpFade 1s ease forwards;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-shadow: 0 2px 5px rgba(0,0,0,0.7);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.primary-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

.primary-button:hover {
    background-color: #dc2626;
    transform: scale(1.05);
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.6);
}

.hero-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    z-index: 3;
}

.control {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s ease;
}

.control:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.2);
}

.hero-indicators {
    position: absolute;
    bottom: 2%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 3;
}

.indicator {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transition: background 0.2s ease, transform 0.3s ease;
    cursor: pointer;
}

.indicator:hover {
    transform: scale(1.3);
    background: var(--primary-color);
}

.indicator.active {
    background: white;
    transform: scale(1.4);
}

/* Featured Section */
.featured {
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: bold;
}

.filter-buttons {
    display: flex;
    gap: 1rem;
}

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.text-button:hover {
    color: #dc2626;
    transform: scale(1.1);
}

/* Anime Grid */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.anime-card {
    background-color: var(--bg-darker);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-right: 0.5rem;
    cursor: pointer;
    box-shadow: 0 0 0 transparent;
}

.anime-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.5);
}

.anime-image {
    position: relative;
    overflow: hidden;
    border-radius: 1rem 1rem 0 0;
}

.anime-image img {
    width: 100%;
    height: 16rem;
    transition: transform 0.4s ease;
}

.anime-card:hover .anime-image img {
    transform: scale(1.1);
}

.rating {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.anime-info {
    padding: 1rem;
}

.anime-info p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* النسخة القياسية */
    overflow: hidden;
    text-overflow: ellipsis;
}

.anime-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.anime-info h3:hover {
    color: var(--primary-color);
    cursor: pointer;
}

.anime-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.anime-meta span {
    color: var(--text-gray);
}

.watch-button {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: .5rem 1rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 7px;
    margin-left: 7px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 3px 6px rgba(239, 68, 68, 0.5);
}

.watch-button:hover {
    background-color: #dc2626;
    transform: scale(1.05);
    box-shadow: 0 5px 12px rgba(220, 38, 38, 0.7);
}

.watch-button.active {
    background-color: #4b5563;
    color: #ededed;
    border: 3px solid #000000;
    box-shadow: none;
    transform: none;
}

/* زر القائمة الجانبية (الهامبرغر) */
.menu-btn {
    font-size: 24px;
    background-color: #007bff;
    color: var(--text-light);
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1600;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.menu-btn:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

/* القائمة الجانبية */
.sidebar {
    position: fixed;
    top: 0;
    right: -270px; /* مساحة أكبر خارج الشاشة */
    width: 270px; /* أعرض قليلاً */
    height: 100%;
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    color: var(--text-light);
    padding-top: 60px;
    box-shadow:
      -4px 0 15px rgba(239, 68, 68, 0.5),
      inset 0 0 10px rgba(255, 255, 255, 0.05);
    border-radius: 0 0 0 15px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    backdrop-filter: blur(6px);
    z-index: 1500;
    overflow-y: auto;
}

/* تمرير القائمة بشكل أنيق */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 4px;
}

/* عندما تكون القائمة مفتوحة */
.sidebar.active {
    right: 0;
    box-shadow:
      -8px 0 25px rgba(239, 68, 68, 0.8),
      inset 0 0 15px rgba(255, 255, 255, 0.1);
    animation: slideInSidebar 0.4s forwards ease;
}

/* تحريك انزلاقي ناعم */
@keyframes slideInSidebar {
    0% {
        right: -270px;
        opacity: 0;
        filter: blur(4px);
    }
    100% {
        right: 0;
        opacity: 1;
        filter: blur(0);
    }
}

/* الروابط داخل القائمة */
.sidebar ul {
    list-style: none;
    padding: 0 1rem;
    margin: 0;
}

.sidebar ul li {
    margin: 18px 0;
    border-radius: 12px;
    transition: background-color 0.3s ease, transform 0.25s ease;
    padding: 8px 12px;
}

.sidebar ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 20px;
    display: block;
    transition: color 0.3s ease;
    user-select: none;
}

.sidebar ul li:hover {
    background: var(--primary-color);
    transform: translateX(-5px);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.6);
}

.sidebar ul li:hover a {
    color: var(--bg-dark);
}

/* تأثير عند التمرير على روابط القائمة */
.sidebar ul li a:hover {
    color: var(--bg-dark);
    font-weight: 700;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .sidebar {
        width: 220px;
        padding-top: 50px;
    }

    .sidebar ul li a {
        font-size: 18px;
        padding: 8px 10px;
    }
}

/* Filters */
#filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    background-color: #4b556373;
    padding: 15px;
    border-radius: 12px;
    max-width: 900px;
    margin: 0 auto;
    transition: background-color 0.3s ease;
}

#filters:hover {
    background-color: #6b7280a1;
}

#filters label {
    align-items: start;
    font-weight: bold;
}

#filters select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 5px solid #7b2d2d;
    background-color: #0000007d;
    min-width: 140px;
    font-size: 20px;
    margin-top: 4px;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

#filters select:hover,
#filters select:focus {
    border-color: var(--primary-color);
    background-color: #1f2937;
}

/* Responsive */
@media (max-width: 600px) {
    #filters {
        flex-direction: column;
        align-items: center;
    }

    #filters label {
        width: 100%;
        align-items: center;
        text-align: center;
    }

    #filters select {
        width: 100%;
        max-width: 300px;
    }
}

/* إخفاء الزر والقائمة على الشاشات الكبيرة */
@media (min-width: 768px) {
    .menu-btn {
        display: none;
    }

    .sidebar {
        display: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
    }

    .search-bar {
        width: 50%;
        margin: 0;
    }

    .section-header {
        margin-top: 6rem;
    }

    .nav-buttons {
        display: none;
    }

    .icon-button {
        position: absolute;
        right: 90%;
        top: 16%;
    }

    /* Anime Grid */
    .anime-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1.3rem;
    }

    .anime-card {
        background-color: var(--bg-darker);
        border-radius: 1rem;
        overflow: hidden;
        transition


