/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
    direction: rtl;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========== HEADER ========== */
.header {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: #e50914;
}

.logo img {
    height: 40px;
    width: auto;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav a {
    color: #ffffff;
    font-weight: 600;
    transition: color 0.3s;
    padding: 8px 0;
}

.nav a:hover,
.nav a.active {
    color: #e50914;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.search-btn,
.user-btn {
    font-size: 20px;
    padding: 8px;
    color: #ffffff;
    transition: transform 0.2s;
}

.search-btn:hover,
.user-btn:hover {
    transform: scale(1.1);
}

/* ========== MAIN CONTENT ========== */
.main {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}

.page-header p {
    color: #999;
    font-size: 16px;
}

/* ========== MOVIES GRID ========== */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-bottom: 50px;
}

@media (max-width: 1400px) {
    .movies-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1200px) {
    .movies-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .movies-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ========== MOVIE CARD ========== */
.movie-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(229, 9, 20, 0.3);
}

.movie-poster {
    position: relative;
    width: 100%;
    padding-top: 150%; /* 2:3 aspect ratio */
    background: #2a2a2a;
    overflow: hidden;
}

.movie-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.movie-card:hover .movie-poster img {
    transform: scale(1.05);
}

/* Movie Badge */
.movie-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Movie Info */
.movie-info {
    padding: 12px;
}

.movie-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    min-height: 39px;
}

.movie-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

.movie-year {
    opacity: 0.8;
}

.movie-duration {
    opacity: 0.8;
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 30px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1a1a1a;
    color: #ffffff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled):not(.active) {
    background: #2a2a2a;
    border-color: #e50914;
    transform: translateY(-2px);
}

.pagination-btn.active {
    background: #e50914;
    border-color: #e50914;
    color: #ffffff;
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 8px;
    color: #666;
}

/* ========== LOADING & EMPTY STATES ========== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #e50914;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: #999;
    font-size: 16px;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.error-state {
    text-align: center;
    padding: 80px 20px;
}

.error-state p {
    color: #999;
    margin-bottom: 20px;
}

.retry-btn {
    padding: 12px 30px;
    background: #e50914;
    color: #ffffff;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
}

.retry-btn:hover {
    background: #f40612;
}

/* ========== FOOTER ========== */
.footer {
    background: #0a0a0a;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px 0;
    text-align: center;
    color: #666;
}
