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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    background-color: #f1f2f7;
    direction: rtl;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
    border: 0;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ===== Top Bar ===== */
.top-bar {
    background: #1a1a2e;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    padding: 6px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    direction: rtl;
}

.top-bar .date-display {
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-bar .date-display svg {
    width: 14px;
    height: 14px;
    fill: rgba(255, 255, 255, 0.7);
}

.top-bar .top-icons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar .top-icons svg {
    width: 18px;
    height: 18px;
    fill: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: fill 0.2s;
}

.top-bar .top-icons svg:hover {
    fill: #fff;
}

/* ===== Logo Area ===== */
.logo-area {
    background: #fff;
    padding: 15px 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.logo-area a {
    display: inline-block;
}

.logo-area .site-logo {
    height: 45px;
    max-width: 200px;
    object-fit: contain;
}

.logo-area .site-name {
    font-size: 38px;
    font-weight: 800;
    color: #2196F3;
    letter-spacing: -1px;
    line-height: 1;
}

/* ===== Main Navigation ===== */
.main-nav {
    background: #16213e;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.main-nav .nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.main-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
}

.main-nav .nav-links a {
    color: #fff;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.main-nav .nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.main-nav .nav-links a.active {
    background: #2196F3;
    color: #fff;
}

.main-nav .nav-utils {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
}

.main-nav .nav-utils .search-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.main-nav .nav-utils .search-label:hover {
    color: #fff;
}

.main-nav .nav-utils svg {
    width: 18px;
    height: 18px;
    fill: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: fill 0.2s;
}

.main-nav .nav-utils svg:hover {
    fill: #fff;
}

.dark-mode-toggle {
    width: 20px;
    height: 20px;
    fill: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s;
}

/* ===== Page Container ===== */
.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 15px 40px;
}

/* ===== Search Box ===== */
.search-section {
    margin-bottom: 25px;
    text-align: center;
}

.search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    direction: rtl;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e0e0e0;
    border-left: none;
    border-radius: 0 8px 8px 0;
    font-size: 15px;
    font-family: 'Tajawal', sans-serif;
    outline: none;
    background: #fff;
    transition: border-color 0.3s;
    color: #333;
}

.search-form input[type="text"]:focus {
    border-color: #2196F3;
}

.search-form input[type="text"]::placeholder {
    color: #aaa;
}

.search-form .search-btn {
    padding: 12px 28px;
    background: #2196F3;
    color: #fff;
    border: 2px solid #2196F3;
    border-radius: 8px 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.search-form .search-btn:hover {
    background: #1976D2;
    border-color: #1976D2;
}

/* ===== Breadcrumb ===== */
.breadcrumb-section {
    background: #fff;
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 15px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    font-size: 13px;
    color: #777;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-section svg {
    width: 14px;
    height: 14px;
    fill: #2196F3;
}

.breadcrumb-section a {
    color: #2196F3;
    font-weight: 500;
}

.breadcrumb-section a:hover {
    text-decoration: underline;
}

.breadcrumb-section .separator {
    color: #ccc;
    margin: 0 4px;
}

.breadcrumb-section .current {
    color: #999;
}

/* ===== Title Card ===== */
.title-card {
    background: #fff;
    border-radius: 10px;
    padding: 30px 25px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.title-card h1 {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.4;
    margin: 0;
}

/* ===== Result Cards ===== */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    display: flex;
    flex-direction: row;
    direction: rtl;
}

.result-card:hover {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.result-card .card-thumb {
    flex: 0 0 320px;
    min-height: 200px;
    position: relative;
    overflow: hidden;
    background: #0a0a1a;
}

.result-card .card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.result-card:hover .card-thumb img {
    transform: scale(1.05);
}

.result-card .card-thumb .duration-badge {
    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;
    backdrop-filter: blur(4px);
}

.result-card .card-body {
    flex: 1;
    padding: 22px 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-card .card-body h2 {
    font-size: 19px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.5;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-card .card-body .video-meta {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-card .card-body .video-meta svg {
    width: 14px;
    height: 14px;
    fill: #888;
}

.result-card .card-body .video-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-card .card-body .card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: #2196F3;
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-download:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.btn-download svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.btn-play {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: transparent;
    color: #2196F3;
    border: 2px solid #2196F3;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-play:hover {
    background: #2196F3;
    color: #fff;
}

.btn-play svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Player area */
.player-area {
    padding: 0 25px 15px;
}

/* ===== No Data Message ===== */
.no-data {
    background: #fff;
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
}

.no-data svg {
    width: 60px;
    height: 60px;
    fill: #ddd;
    margin-bottom: 15px;
}

.no-data p {
    font-size: 18px;
    color: #999;
    font-weight: 500;
}

/* ===== Related Links / Footer Links ===== */
.related-section {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-top: 25px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
}

.related-section .related-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.related-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.related-tags a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: #f1f2f7;
    color: #444;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.related-tags a:hover {
    background: #2196F3;
    color: #fff;
    border-color: #2196F3;
    transform: translateY(-1px);
}

.related-tags a svg {
    width: 12px;
    height: 12px;
    fill: #2196F3;
    transition: fill 0.3s;
}

.related-tags a:hover svg {
    fill: #fff;
}

/* ===== Footer ===== */
.site-footer {
    background: #1a1a2e;
    color: rgba(255, 255, 255, 0.7);
    padding: 20px 25px;
    margin-top: 40px;
    font-size: 14px;
}

.site-footer .footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.site-footer .footer-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.site-footer a {
    color: #fff;
    font-weight: 500;
    transition: color 0.3s;
}

.site-footer a:hover {
    color: #2196F3;
}

@media (max-width: 768px) {
    .site-footer .footer-container {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
}

/* ===== Scroll to Top ===== */
.scroll-top {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 44px;
    height: 44px;
    background: #2196F3;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
    z-index: 999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-top:hover {
    background: #1976D2;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.5);
}

.scroll-top svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* ===== Dark Mode ===== */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .logo-area,
body.dark-mode .breadcrumb-section,
body.dark-mode .title-card,
body.dark-mode .result-card,
body.dark-mode .no-data,
body.dark-mode .related-section,
body.dark-mode .search-form input[type="text"] {
    background-color: #1e1e2e;
    color: #e0e0e0;
    border-color: #333;
}

body.dark-mode .title-card h1,
body.dark-mode .result-card .card-body h2,
body.dark-mode .related-section .related-title,
body.dark-mode .result-card .card-body .video-meta,
body.dark-mode .result-card .card-body .video-desc {
    color: #ccc;
}

body.dark-mode .search-form input[type="text"]::placeholder {
    color: #888;
}

body.dark-mode .search-form input[type="text"]:focus {
    border-color: #2196F3;
}

body.dark-mode .related-tags a {
    background: #2a2a3c;
    color: #e0e0e0;
}

body.dark-mode .related-tags a:hover {
    background: #2196F3;
    color: #fff;
}

body.dark-mode .related-section .related-title {
    border-bottom-color: #333;
}

body.dark-mode .breadcrumb-section .separator,
body.dark-mode .breadcrumb-section .current {
    color: #aaa;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .result-card {
        flex-direction: column;
    }

    .result-card .card-thumb {
        flex: none;
        max-height: 220px;
        min-height: 180px;
    }

    .result-card .card-body h2 {
        font-size: 17px;
    }

    .title-card h1 {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .main-nav .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: #16213e;
        flex-direction: column;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        z-index: 100;
    }

    .main-nav .nav-links.active {
        display: flex;
    }

    .main-nav .nav-links a {
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .menu-toggle {
        display: block;
    }

    .logo-area .site-name {
        font-size: 28px;
    }

    .search-form {
        flex-direction: row;
    }

    .result-card .card-body {
        padding: 15px 18px;
    }

    .result-card .card-body h2 {
        font-size: 16px;
    }

    .title-card h1 {
        font-size: 20px;
    }

    .title-card {
        padding: 20px 15px;
    }

    .breadcrumb-section {
        font-size: 12px;
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .top-bar {
        font-size: 11px;
        padding: 5px 12px;
    }

    .search-form input[type="text"] {
        padding: 10px 12px;
        font-size: 14px;
    }

    .search-form .search-btn {
        padding: 10px 18px;
        font-size: 14px;
    }

    .result-card .card-thumb {
        max-height: 180px;
        min-height: 150px;
    }

    .btn-download,
    .btn-play {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ===== Font Awesome Compatibility ===== */
@font-face {
    font-family: FontAwesome;
    font-display: swap;
    src: url(/sub/fonts/fontawesome-webfont.eot?v=4.2.0);
    src: url(/sub/fonts/fontawesome-webfont.eot?#iefix&v=4.2.0) format('embedded-opentype'),
        url(/sub/fonts/fontawesome-webfont.woff?v=4.2.0) format('woff'),
        url(/sub/fonts/fontawesome-webfont.ttf?v=4.2.0) format('truetype'),
        url(/sub/fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular) format('svg');
    font-weight: 400;
    font-style: normal;
}

.fa {
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    font-size: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

.fa-music:before {
    content: "\f001";
}

.fa-search:before {
    content: "\f002";
}

.fa-home:before {
    content: "\f015";
}

.fa-download:before {
    content: "\f019";
}

.fa-play:before {
    content: "\f04b";
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card {
    animation: fadeInUp 0.4s ease forwards;
}

.result-card:nth-child(1) {
    animation-delay: 0.05s;
}

.result-card:nth-child(2) {
    animation-delay: 0.1s;
}

.result-card:nth-child(3) {
    animation-delay: 0.15s;
}

.result-card:nth-child(4) {
    animation-delay: 0.2s;
}

.result-card:nth-child(5) {
    animation-delay: 0.25s;
}

.result-card:nth-child(6) {
    animation-delay: 0.3s;
}

.result-card:nth-child(7) {
    animation-delay: 0.35s;
}

.result-card:nth-child(8) {
    animation-delay: 0.4s;
}

.result-card:nth-child(9) {
    animation-delay: 0.45s;
}

.result-card:nth-child(10) {
    animation-delay: 0.5s;
}