/*
Theme Name: ScoreLand Light
Theme URI: https://sp.games
Description: ثيم خفيف وسريع مخصص لموقع سكوري لاند - محسّن للأداء وقليل الاستعلامات
Author: ScoreLand Team
Author URI: https://sp.games
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: scoreland-light
Tags: light-weight, fast, minimal, performance, rtl-language-support, custom-menu, featured-images, threaded-comments, translation-ready

ScoreLand Light is a lightweight, fast, and optimized theme specifically designed for ScoreLand website.
It focuses on performance with minimal database queries and clean code.
*/

/* ============================================
   Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #fff;
    direction: rtl;
}

/* ============================================
   Layout
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.site-header .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.site-branding {
    width: 100%;
    text-align: center;
    order: 1;
}

.site-title {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
}

.site-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.site-title a:hover {
    color: #0073aa;
}

/* Logo */
.site-logo {
    margin: 0;
    display: inline-block;
}

.site-logo a {
    display: inline-block;
    text-decoration: none;
}

.logo-img {
    max-height: 150px;
    max-width: 150px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

/* تحسين الشعار على الجوال */
@media (max-width: 767px) {
    .logo-img {
        max-height: 80px;
        max-width: 80px;
    }
}

.site-description {
    margin: 3px 0 0;
    font-size: 14px;
    color: #666;
}

/* Mobile Actions (Search & Hamburger) */
.mobile-actions {
    display: none;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    order: 2;
}

/* Nav Wrapper */
.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    order: 3;
}

.desktop-search-toggle {
    display: flex;
}

/* Search Toggle Button */
.search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #333;
    transition: color 0.3s;
}

.search-toggle:hover {
    color: #0073aa;
}

.search-toggle svg {
    width: 20px;
    height: 20px;
}

/* Search Form Wrapper */
.search-form-wrapper {
    display: none;
    width: 100%;
    order: 4;
    margin-top: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-form-wrapper.active {
    display: block;
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-field {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-field:focus {
    border-color: #0073aa;
}

.search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-submit:hover {
    background: #005a87;
}

.search-submit svg {
    width: 18px;
    height: 18px;
}

/* Menu Toggle Button (Hamburger) */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    position: relative;
}

.menu-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
    height: 18px;
}

.menu-toggle-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Navigation */
.main-navigation {
    position: relative;
    margin-top: 0;
}

.site-header {
    position: relative;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    color: #222;
    text-decoration: none;
    padding: 8px 12px;
    display: block;
    transition: color 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.main-navigation a:hover {
    color: #0073aa;
}

/* News Ticker Wrapper */
.news-ticker-wrapper {
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 0;
}

.news-ticker-wrapper .container {
    padding: 0 20px;
}

/* ============================================
   Content Area
   ============================================ */
.site-content {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

.content-area {
    width: 100%;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* تنسيق Grid للعناصر المخصصة (extend-ctl-user, extend-achievement, extend-ctl-top-score) */
.loop,
.loop-grid,
.results,
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.loop .item,
.loop-grid .item,
.results .item,
.grid .item {
    width: 100%;
}

/* Posts */
.post {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background: #fff;
}

.post:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.post:last-child {
    border-bottom: none;
}

.post-title {
    font-size: 18px;
    margin-bottom: 10px;
    line-height: 1.4;
    font-variant-ligatures: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.post-title a {
    color: #222;
    text-decoration: none;
    font-weight: 600;
}

.post-title a:hover {
    color: #0073aa;
}

/* تصغير وتغميق الخط في عناوين الألعاب (grid) */
.posts-grid .post-title {
    font-size: 14px;
    line-height: 1.3;
}

.posts-grid .post-title a {
    font-size: 14px;
    font-weight: 600;
    color: #222;
}

/* تصغير الخط الإنجليزي في عناوين الصفحة الرئيسية */
.sp-post-title-small,
.sp-post-title-small a {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.sp-post-title-small a {
    text-decoration: none;
    transition: color 0.3s;
}

.sp-post-title-small a:hover {
    color: #0073aa;
}

.post-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.post-content {
    margin-top: 20px;
}

.post-thumbnail {
    width: 100%;
    overflow: hidden;
    margin-bottom: 15px;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.post:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-content {
    padding: 0 15px 15px;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* تنسيق النصوص في المحتوى */
.post-content p {
    margin: 0 0 1.2em 0;
    padding: 0;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin: 1.5em 0 0.8em 0;
    font-weight: bold;
    line-height: 1.3;
    color: #222;
}

.post-content h1 {
    font-size: 2em;
}

.post-content h2 {
    font-size: 1.75em;
}

.post-content h3 {
    font-size: 1.5em;
}

.post-content h4 {
    font-size: 1.25em;
}

.post-content h5,
.post-content h6 {
    font-size: 1.1em;
}

.post-content ul,
.post-content ol {
    margin: 1.2em 0;
    padding-right: 2em;
}

.post-content ul {
    list-style-type: disc;
}

.post-content ol {
    list-style-type: decimal;
}

.post-content li {
    margin: 0.5em 0;
    line-height: 1.8;
}

.post-content blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
    border-right: 4px solid #0073aa;
    background: #f5f5f5;
    font-style: italic;
    color: #555;
}

.post-content a {
    color: #0073aa;
    text-decoration: underline;
    transition: color 0.2s;
}

.post-content a:hover {
    color: #005a87;
}

.post-content strong,
.post-content b {
    font-weight: bold;
    color: #222;
}

.post-content em,
.post-content i {
    font-style: italic;
}

.post-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}

.post-content pre {
    background: #f5f5f5;
    padding: 1em;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1.5em 0;
    line-height: 1.6;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: #333;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5em auto;
    border-radius: 4px;
    display: block;
}

/* محاذاة الصور في المحتوى (للملفات الشخصية) */
.post-content img,
.page-content img,
.ctl-extend-user-profile img,
.ctl-extend-user-profile-card img,
.avatar,
.wp-user-avatar {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* محاذاة الصور داخل الجداول */
.post-content table img,
.page-content table img {
    margin: 0 auto;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

.post-content table th,
.post-content table td {
    padding: 0.75em;
    border: 1px solid #ddd;
    text-align: right;
}

.post-content table th {
    background: #f5f5f5;
    font-weight: bold;
}

.post-content hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 2em 0;
}

/* Post Navigation (السابق والتالي) */
.posts-navigation {
    margin: 3em 0 2em;
    padding-top: 2em;
    border-top: 2px solid #e0e0e0;
}

.posts-navigation .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.posts-navigation .nav-previous,
.posts-navigation .nav-next {
    display: flex;
    flex-direction: column;
}

.posts-navigation .nav-previous {
    text-align: right;
}

.posts-navigation .nav-next {
    text-align: left;
}

.posts-navigation a {
    display: block;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
}

.posts-navigation a:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.2);
}

.posts-navigation .nav-subtitle {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    margin-bottom: 5px;
    transition: color 0.3s;
}

.posts-navigation a:hover .nav-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

.posts-navigation .nav-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #222;
    transition: color 0.3s;
}

.posts-navigation a:hover .nav-title {
    color: #fff;
}

/* أيقونات للتنقل */
.posts-navigation .nav-previous a::before {
    content: '←';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.posts-navigation .nav-next a::after {
    content: '→';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.posts-navigation a:hover::before,
.posts-navigation a:hover::after {
    opacity: 1;
}

/* تحسينات للجوال */
@media (max-width: 767px) {
    .posts-navigation .nav-links {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .posts-navigation .nav-previous,
    .posts-navigation .nav-next {
        text-align: center;
    }
    
    .posts-navigation a {
        padding: 12px 15px;
    }
    
    .posts-navigation .nav-title {
        font-size: 14px;
    }
    
    .posts-navigation .nav-previous a::before,
    .posts-navigation .nav-next a::after {
        display: none;
    }
    
    .post-content {
        font-size: 15px;
        padding: 0 10px 10px;
    }
    
    .post-content h1 {
        font-size: 1.75em;
    }
    
    .post-content h2 {
        font-size: 1.5em;
    }
    
    .post-content h3 {
        font-size: 1.25em;
    }
    
    .post-content blockquote {
        padding: 0.8em 1em;
    }
    
    .post-content ul,
    .post-content ol {
        padding-right: 1.5em;
    }
}

.entry-header {
    padding: 15px 15px 0;
}

/* Post Share (أزرار المشاركة) */
.post-share {
    margin: 2em 0 1.5em;
    padding: 1em 20px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.post-share .share-label {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.post-share .xs_social_share_widget,
.post-share .xs_social_share {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.post-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
}

.post-share a:hover {
    transform: translateY(-2px);
    opacity: 0.8;
}

/* Post Tags */
.post-tags {
    margin-top: 1.5em;
    padding: 1em 20px 0;
}

.post-tags a {
    display: inline-block;
    padding: 5px 12px;
    margin: 5px 5px 5px 0;
    background: #f5f5f5;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.post-tags a:hover {
    background: #0073aa;
    color: #fff;
}

/* تحسينات للجوال */
@media (max-width: 767px) {
    .post-share {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .post-share .share-label {
        font-size: 15px;
    }
    
    .post-share {
        padding: 1em 15px;
    }
    
    .post-tags {
        padding: 1em 15px 0;
    }
}

/* Single Post */
.single-post .post-title {
    font-size: 36px;
    margin-bottom: 20px;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: #f5f5f5;
    padding: 30px 0;
    margin-top: 60px;
    border-top: 1px solid #e0e0e0;
}

.site-footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Footer Navigation */
.footer-navigation {
    width: 100%;
    margin-bottom: 15px;
}

.footer-navigation ul {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-navigation li {
    margin: 0;
    padding: 0;
}

.footer-navigation a {
    color: #222;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 15px;
    transition: color 0.3s;
    display: block;
}

.footer-navigation a:hover {
    color: #0073aa;
}

/* Copyright */
.copyright {
    margin: 0;
    padding: 0;
    color: #666;
    font-size: 14px;
    text-align: right;
    direction: rtl;
}

/* زر المفضلة - تصميم أنيق بلون أخضر */
.add-to-favourite,
button.add-to-favourite,
.btn.add-to-favourite {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    text-decoration: none;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
    max-width: fit-content;
    width: fit-content;
}

.add-to-favourite:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.add-to-favourite:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.add-to-favourite:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

/* حالة الزر عند الإضافة للمفضلة */
.add-to-favourite.added,
.add-to-favourite.active {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.add-to-favourite.added::after {
    content: ' ✓';
    margin-right: 5px;
    font-weight: bold;
}

/* تحسين التنسيق في المحتوى */
.post-content .add-to-favourite,
.page-content .add-to-favourite,
.post-content .delete-from-favourite,
.page-content .delete-from-favourite,
.post-content p .add-to-favourite,
.page-content p .add-to-favourite,
.post-content p .delete-from-favourite,
.page-content p .delete-from-favourite {
    margin: 20px auto !important;
    display: block !important;
    max-width: fit-content;
    text-align: center !important;
    width: fit-content;
}

/* توسيط الأزرار فقط - بدون التأثير على العنصر الأب */
p .add-to-favourite,
p .delete-from-favourite,
div .add-to-favourite,
div .delete-from-favourite {
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    text-align: center !important;
    float: none !important;
    width: fit-content !important;
}

/* توسيط جميع أزرار المفضلة */
.add-to-favourite,
.delete-from-favourite,
button.add-to-favourite,
button.delete-from-favourite {
    margin-left: auto;
    margin-right: auto;
    display: block;
    text-align: center;
}

/* في المحتوى */
.post-content .add-to-favourite,
.post-content .delete-from-favourite,
.page-content .add-to-favourite,
.page-content .delete-from-favourite {
    margin: 20px auto;
    display: block;
    text-align: center;
}

/* تحسين شكل الأزرار العامة */
.btn,
button.btn,
input[type="submit"].btn,
input[type="button"].btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:focus,
button.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.25);
}

.btn:hover,
button.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active,
button.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* زر Primary (أزرق) */
.btn-primary,
button.btn-primary {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #ffffff;
}

.btn-primary:hover,
button.btn-primary:hover {
    background: linear-gradient(135deg, #005a87 0%, #004a6f 100%);
    color: #ffffff;
}

/* زر Secondary (رمادي) */
.btn-secondary,
button.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: #ffffff;
}

.btn-secondary:hover,
button.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    color: #ffffff;
}

/* زر Success (أخضر) */
.btn-success,
button.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: #ffffff;
}

.btn-success:hover,
button.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    color: #ffffff;
}

/* زر Danger (أحمر) */
.btn-danger,
button.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #ffffff;
}

.btn-danger:hover,
button.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    color: #ffffff;
}

/* زر Warning (برتقالي) */
.btn-warning,
button.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.btn-warning:hover,
button.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%);
    color: #212529;
}

/* زر Info (أزرق فاتح) */
.btn-info,
button.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: #ffffff;
}

.btn-info:hover,
button.btn-info:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    color: #ffffff;
}

/* تحسين التنسيق في المحتوى */
.post-content .btn,
.page-content .btn {
    margin: 10px 5px;
}

@media (max-width: 767px) {
    .btn,
    button.btn {
        padding: 8px 16px;
        font-size: 13px;
        width: 100%;
        max-width: 100%;
    }
}

/* زر شاشة كاملة */
.make-iframe-full-screen,
button.make-iframe-full-screen {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #ffffff;
}

.make-iframe-full-screen:hover,
button.make-iframe-full-screen:hover {
    background: linear-gradient(135deg, #005a87 0%, #004a6f 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.make-iframe-full-screen:active,
button.make-iframe-full-screen:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.make-iframe-full-screen:focus,
button.make-iframe-full-screen:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.25);
}

@media (max-width: 767px) {
    .make-iframe-full-screen,
    button.make-iframe-full-screen {
        padding: 8px 16px;
        font-size: 13px;
        width: 100%;
        max-width: 100%;
    }
}

/* تحسين شكل التنقل بين الصفحات (Pagination) - فقط لأرقام الصفحات */
.pagination,
.page-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 40px 0;
    padding: 0;
    list-style: none;
}

.pagination a,
.pagination span,
.page-numbers a,
.page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #333;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pagination a:hover,
.page-numbers a:hover {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #ffffff;
    border-color: #0073aa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.2);
}

.pagination .current,
.pagination span.current,
.page-numbers .current,
.page-numbers span.current {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #ffffff;
    border-color: #0073aa;
    cursor: default;
    font-weight: 700;
}

.pagination .dots,
.page-numbers .dots {
    background: transparent;
    border: none;
    color: #666;
    cursor: default;
    font-weight: 400;
}

.pagination .dots:hover,
.page-numbers .dots:hover {
    background: transparent;
    color: #666;
    transform: none;
    box-shadow: none;
}

.pagination .prev,
.pagination .next,
.page-numbers .prev,
.page-numbers .next {
    padding: 8px 16px;
    min-width: auto;
}

.pagination .prev:hover,
.pagination .next:hover,
.page-numbers .prev:hover,
.page-numbers .next:hover {
    background: linear-gradient(135deg, #005a87 0%, #004a6f 100%);
}

/* التنقل بين الصفحات في التعليقات */
.comments-pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 40px 0;
    padding: 0;
    list-style: none;
}

.comments-pagination .nav-links a,
.comments-pagination .nav-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #333;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.comments-pagination .nav-links a:hover {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #ffffff;
    border-color: #0073aa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.2);
}

.comments-pagination .nav-links .current,
.comments-pagination .nav-links span.current {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #ffffff;
    border-color: #0073aa;
    cursor: default;
    font-weight: 700;
}

@media (max-width: 767px) {
    .pagination,
    .page-numbers,
    .comments-pagination .nav-links {
        gap: 5px;
        margin: 30px 0;
    }
    
    .pagination a,
    .pagination span,
    .page-numbers a,
    .page-numbers span,
    .comments-pagination .nav-links a,
    .comments-pagination .nav-links span {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .pagination .prev,
    .pagination .next,
    .page-numbers .prev,
    .page-numbers .next,
    .comments-pagination .nav-links .prev,
    .comments-pagination .nav-links .next {
        padding: 6px 12px;
    }
}

/* تحسين شكل التعليقات */
.comments-area {
    margin: 40px 0;
    padding: 20px 0;
}

.comments-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #222;
}

.comments-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

.comments-load-more {
    text-align: center;
    margin: 30px 0;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.comment-author {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-left: 15px;
    border: 2px solid #e0e0e0;
}

.comment-author .fn {
    font-weight: 600;
    color: #222;
    font-size: 16px;
}

.comment-author .fn a {
    color: #222;
    text-decoration: none;
}

.comment-author .fn a:hover {
    color: #0073aa;
}

.comment-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
}

.comment-meta a {
    color: #666;
    text-decoration: none;
}

.comment-meta a:hover {
    color: #0073aa;
}

.comment-content {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
}

.comment-content p {
    margin-bottom: 10px;
}

.comment-reply-link {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #0073aa;
    background: #ffffff;
    border: 1px solid #0073aa;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.comment-reply-link:hover {
    background: #0073aa;
    color: #ffffff;
}

.children {
    margin-top: 20px;
    margin-right: 40px;
    padding-right: 20px;
    border-right: 2px solid #e0e0e0;
}

.children .comment {
    background: #ffffff;
    border: 1px solid #f0f0f0;
}

@media (max-width: 767px) {
    .comments-area {
        margin: 30px 0;
        padding: 15px 0;
    }
    
    .comments-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .comment {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .children {
        margin-right: 20px;
        padding-right: 15px;
    }
}

@media (max-width: 767px) {
    .add-to-favourite,
    button.add-to-favourite,
    .btn.add-to-favourite {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        max-width: 300px;
    }
}

/* زر حذف المفضلة - تصميم أنيق بلون أحمر */
.delete-from-favourite,
button.delete-from-favourite,
.btn.delete-from-favourite {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
    display: inline-block;
    text-align: center;
    text-decoration: none;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
}

.delete-from-favourite:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.delete-from-favourite:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.delete-from-favourite:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

/* حالة الزر عند الحذف من المفضلة */
.delete-from-favourite.deleted,
.delete-from-favourite.active {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

.delete-from-favourite.deleted::after {
    content: ' ✗';
    margin-right: 5px;
    font-weight: bold;
}

/* تحسين التنسيق في المحتوى */
.post-content .delete-from-favourite,
.page-content .delete-from-favourite {
    margin: 20px auto;
    display: block;
    max-width: fit-content;
}

@media (max-width: 767px) {
    .delete-from-favourite,
    button.delete-from-favourite,
    .btn.delete-from-favourite {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        max-width: 300px;
    }
}

.copyright a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.copyright a:hover {
    color: #0073aa;
}

/* عرض النتائج - تصميم أنيق */
#ctl-user-top-score,
#ctl-user-last-score {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 15px 0;
    font-size: 16px;
    font-weight: 500;
    color: #495057;
    display: inline-block;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#ctl-user-top-score::before,
#ctl-user-last-score::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    transition: width 0.3s ease;
}

#ctl-user-last-score::before {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

#ctl-user-top-score:hover,
#ctl-user-last-score:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #adb5bd;
}

#ctl-user-top-score:hover::before,
#ctl-user-last-score:hover::before {
    width: 6px;
}

.score-value {
    font-size: 20px;
    font-weight: 700;
    color: #10b981;
    margin-right: 8px;
    display: inline-block;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#ctl-user-last-score .score-value {
    color: #3b82f6;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* تحسين التنسيق في المحتوى */
.post-content #ctl-user-top-score,
.post-content #ctl-user-last-score,
.page-content #ctl-user-top-score,
.page-content #ctl-user-last-score {
    display: block;
    text-align: center;
    margin: 20px auto;
    max-width: 400px;
}

@media (max-width: 767px) {
    #ctl-user-top-score,
    #ctl-user-last-score {
        font-size: 14px;
        padding: 12px 16px;
        min-width: auto;
        width: 100%;
        max-width: 100%;
    }
    
    .score-value {
        font-size: 18px;
    }
}

/* تحسينات للجوال */
@media (max-width: 767px) {
    .footer-navigation ul {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .footer-navigation a {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .copyright {
        font-size: 13px;
    }
}


/* ============================================
   Utilities
   ============================================ */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* ============================================
   Responsive
   ============================================ */

/* سطح المكتب - 6 مقالات في صف واحد */
@media (min-width: 1200px) {
    .posts-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 15px;
    }
    
    .post-title {
        font-size: 16px;
    }
    
    /* Grid للعناصر المخصصة - 6 أعمدة */
    .loop,
    .loop-grid,
    .results,
    .grid,
    .grid-6 {
        grid-template-columns: repeat(6, 1fr);
        gap: 15px;
    }
}

/* الشاشات الأفقية (Tablets) - 4 مقالات في صف واحد */
@media (min-width: 768px) and (max-width: 1199px) {
    .posts-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
    
    .post-title {
        font-size: 16px;
    }
    
    /* Grid للعناصر المخصصة - 4 أعمدة */
    .loop,
    .loop-grid,
    .results,
    .grid,
    .grid-6.md\:grid-3,
    [class*="md:grid-3"] {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
}

/* الشاشات العمودية (Mobile) - 2 مقالات في صف واحد */
@media (max-width: 767px) {
    .site-header .container {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    /* إظهار mobile-actions على الجوال */
    .mobile-actions {
        display: flex;
    }
    
    /* إخفاء desktop search toggle */
    .desktop-search-toggle {
        display: none;
    }
    
    /* إخفاء nav-wrapper على الجوال */
    .nav-wrapper {
        display: none;
        order: 3;
        width: 100%;
    }
    
    /* إظهار nav-wrapper عند التفعيل */
    .nav-wrapper.toggled {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    /* إخفاء القائمة افتراضياً على الجوال */
    .main-navigation {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    /* إظهار القائمة عند التفعيل */
    .main-navigation.toggled {
        max-height: 500px;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        padding: 10px 0;
    }
    
    .main-navigation li {
        border-bottom: 1px solid #f0f0f0;
    }
    
    .main-navigation li:last-child {
        border-bottom: none;
    }
    
    .main-navigation a {
        padding: 12px 20px;
        display: block;
    }
    
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .post-title {
        font-size: 14px;
    }
    
    /* Grid للعناصر المخصصة - عمودين */
    .loop,
    .loop-grid,
    .results,
    .grid,
    .grid-6.xs\:grid-2,
    [class*="xs:grid-2"] {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .single-post .post-title {
        font-size: 28px;
    }
}

/* سطح المكتب - إخفاء mobile-actions وإظهار nav-wrapper */
@media (min-width: 768px) {
    .mobile-actions {
        display: none;
    }
    
    .desktop-search-toggle {
        display: flex;
    }
}

