/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0a0a0a;
    color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
}

.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== NAVBAR ========== */
.navbar {
    background-color: #111;
    border-bottom: 2px solid #222;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.nav-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

/* Logo */
.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.nav-left:hover {
    opacity: 0.8;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #ffd700;
}

.logo-text {
    color: #ffd700;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

/* Search box */
.nav-center {
    flex: 1;
    max-width: 600px;
    margin: 0 20px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 20px; /* ← غيرت من 50px إلى 45px لليمين */
    background-color: #222;
    border: 2px solid #333;
    border-radius: 30px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.search-input::placeholder {
    color: #888;
}

.search-btn {
    position: absolute;
    right: 15px; /* ← تأكد أنه على اليمين */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s;
}

.search-btn:hover {
    color: #ffd700;
}

.search-btn svg {
    width: 20px;
    height: 20px;
}

/* Mobile menu button */
.nav-right {
    display: none;
}

.menu-toggle {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.menu-toggle:hover {
    background-color: #333;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* Main menu */
.nav-menu {
    background-color: #1a1a1a;
    padding: 0 20px;
    border-top: 1px solid #222;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    justify-content: center;
    gap: 30px;
}

.nav-link {
    display: block;
    padding: 15px 20px;
    color: #ddd;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: #ffd700;
    border-bottom-color: #ffd700;
}

/* ========== Filter Indicator ========== */
.filter-indicator {
    background: linear-gradient(135deg, #1a1a1a, #222);
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: none;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-indicator.active {
    display: flex;
}

#filter-text {
    color: #ffd700;
    font-weight: 500;
}

.clear-filter-btn {
    background: #333;
    color: #fff;
    border: 1px solid #444;
    padding: 6px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.clear-filter-btn:hover {
    background: #444;
    border-color: #ffd700;
    color: #ffd700;
}

/* ========== Video Content ========== */
.content-container {
    flex: 1;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

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

.video-card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #222;
    position: relative;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    border-color: #ffd700;
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background-color: #000;
}

/* Preview video */
.video-thumbnail .preview-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.video-duration {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 2;
}

.video-info {
    padding: 15px;
}

/* ========== VIDEO TITLE WITH ELLIPSIS - SINGLE LINE ========== */
.video-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    
    /* سطر واحد مع ... */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.video-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.video-tag {
    background: #333;
    color: #ddd;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    transition: all 0.3s;
}

.video-tag:hover {
    background: #444;
    color: #ffd700;
}

/* ========== Video Preview Progress Bar ========== */
.video-preview-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #ffd700, #ffaa00);
    transition: width 1s linear;
    z-index: 3;
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
    flex-wrap: wrap;
}

.page-btn {
    background: #222;
    color: #fff;
    border: 1px solid #333;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    min-width: 45px;
}

.page-btn:hover:not(.active) {
    background: #333;
    border-color: #444;
}

.page-btn.active {
    background: #ffd700;
    color: #000;
    border-color: #ffd700;
    font-weight: bold;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== Ad ========== */
.ad-section {
    padding: 20px;
    background: #111;
    margin: 20px;
    border-radius: 10px;
    text-align: center;
}

.ad-placeholder {
    background: linear-gradient(135deg, #1a237e, #311b92);
    color: white;
    padding: 40px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
}

/* ========== Footer ========== */
.footer {
    background: #111;
    padding: 25px 20px;
    text-align: center;
    border-top: 1px solid #222;
    margin-top: auto;
}

.footer-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.footer-action-btn {
    background: #333;
    color: #fff;
    border: 1px solid #444;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.footer-action-btn:hover {
    background: #444;
    border-color: #ffd700;
    color: #ffd700;
    transform: translateY(-2px);
}

.footer p {
    color: #888;
    font-size: 14px;
}

/* ========== Mobile Side Menu ========== */
.side-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: #111;
    z-index: 1100;
    transition: right 0.4s ease;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.side-menu.active {
    right: 0;
}

.side-menu-header {
    padding: 20px;
    border-bottom: 1px solid #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-menu-header h3 {
    color: #ffd700;
    font-size: 20px;
}

.close-menu-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.close-menu-btn:hover {
    color: #ffd700;
}

.side-menu-list {
    list-style: none;
    padding: 20px 0;
    flex: 1;
}

.side-menu-link {
    display: block;
    padding: 15px 25px;
    color: #ddd;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    border-right: 3px solid transparent;
}

.side-menu-link:hover,
.side-menu-link.active {
    color: #ffd700;
    background: #1a1a1a;
    border-right-color: #ffd700;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .nav-right {
        display: block;
    }
    
    .nav-menu {
        display: none;
    }
    
    .nav-center {
        margin: 0 10px;
        max-width: 400px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .video-thumbnail {
        height: 160px;
    }
    
    .nav-link {
        padding: 12px 15px;
        font-size: 15px;
    }
    
    .footer-buttons {
        gap: 10px;
    }
    
    .footer-action-btn {
        padding: 8px 15px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .nav-top {
        padding: 10px 15px;
    }
    
    .search-input {
        padding: 10px 45px 10px 15px;
        font-size: 14px;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .logo-text {
        display: none;
    }
    
    .page-btn {
        padding: 8px 15px;
        min-width: 40px;
        font-size: 14px;
    }
    
    .filter-indicator {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .footer-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-action-btn {
        width: 100%;
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* ========== LOADING ANIMATION ========== */
.loading {
    text-align: center;
    padding: 50px;
    color: #888;
}

.loading-spinner {
    border: 3px solid #333;
    border-top: 3px solid #ffd700;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-state {
    text-align: center;
    padding: 50px;
    color: #888;
    grid-column: 1 / -1;
}

.spinner {
    border: 3px solid #333;
    border-top: 3px solid #ffd700;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    grid-column: 1 / -1;
}

.empty-state-icon {
    font-size: 60px;
    margin-bottom: 20px;
    color: #333;
}

/* ========== TRANSITIONS ========== */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

/* ========== AGE VERIFICATION MODAL ========== */
.age-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.age-modal {
    background: #1a1a1a;
    border: 2px solid #ffd700;
    border-radius: 20px;
    padding: 40px 30px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    animation: modalFadeIn 0.5s;
}

@keyframes modalFadeIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.age-modal h2 {
    color: #ffd700;
    font-size: 32px;
    margin-bottom: 15px;
    font-weight: bold;
}

.age-modal p {
    color: #fff;
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.age-modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.age-btn {
    padding: 14px 40px;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 140px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.age-btn-yes {
    background: #2e7d32;
    color: white;
    border: 1px solid #2e7d32;
}

.age-btn-yes:hover {
    background: #1b5e20;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 125, 50, 0.4);
}

.age-btn-no {
    background: #b71c1c;
    color: white;
    border: 1px solid #b71c1c;
}

.age-btn-no:hover {
    background: #8b0000;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(183, 28, 28, 0.4);
}

body.modal-active {
    overflow: hidden;
}

.age-modal-overlay.hidden {
    display: none;
}


/* ===== إخفاء وإظهار حسب الشاشة ===== */
.ad-desktop { display: block; }
.ad-tablet { display: none; }
.ad-mobile { display: none; }

@media (min-width: 769px) and (max-width: 1024px) {
    .ad-desktop { display: none; }
    .ad-tablet { display: block; }
    .ad-mobile { display: none; }
}

@media (max-width: 768px) {
    .ad-desktop { display: none; }
    .ad-tablet { display: none; }
    .ad-mobile { display: block; }
}

/* تنسيق الصور */
.ad-desktop, .ad-tablet, .ad-mobile {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}