@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;900&display=swap');

:root {
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --card-bg: #ffffff;
    --card-border: rgba(56, 189, 248, 0.2);
    --primary-color: #0284c7;
    --accent-color: #38bdf8;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

body.dark-mode {
    --bg-color: #030712;
    --text-color: #f8fafc;
    --card-bg: rgba(15, 23, 42, 0.75);
    --card-border: rgba(56, 189, 248, 0.25);
    --primary-color: #38bdf8;
    --accent-color: #818cf8;
    --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* الهيدر الرئيسي */
.page-header {
    width: 100%;
    max-height: 300px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.header-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    filter: brightness(0.9);
    animation: headerZoom 15s ease-in-out infinite alternate;
}

@keyframes headerZoom {
    0% { transform: scale(1.02); }
    100% { transform: scale(1.08); }
}

/* حاوية المحتوى الرئيسية */
.article-container {
    max-width: 900px;
    width: 100%;
    margin: -40px auto 50px auto;
    padding: 30px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 10;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* شريط التحكم */
.controls-bar {
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    padding: 12px 20px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    gap: 15px;
    flex-wrap: wrap;
}

.lang-btn, .theme-btn, .home-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
}

.home-btn {
    background: linear-gradient(135deg, #64748b, #94a3b8);
    box-shadow: 0 4px 15px rgba(100, 116, 139, 0.25);
}

.lang-btn:hover, .theme-btn:hover, .home-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

/* العناوين والأقسام */
h1 {
    font-size: 2.2rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
}

section:last-of-type {
    border-bottom: none;
}

h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* بطاقة المدرب */
.coach-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-color);
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--card-border);
}

.coach-img-placeholder {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--accent-color);
}

.coach-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    transition: transform 0.5s ease;
}

.coach-card:hover .coach-avatar {
    transform: scale(1.1);
}

.coach-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-color);
}

.coach-info p {
    font-size: 0.95rem;
    opacity: 0.8;
}

/* القوائم */
ul {
    list-style-position: inside;
    padding-right: 10px;
}

ul li {
    font-size: 1.05rem;
    margin-bottom: 10px;
    opacity: 0.9;
    line-height: 1.6;
}

/* القائمة الجانبية العائمة (Side Menu) */
html[dir="rtl"] .en-text,
html[dir="ltr"] .ar-text {
    display: none !important;
}

.side-info-container {
    position: fixed;
    top: 20px;
    z-index: 99999;
}

html[dir="rtl"] .side-info-container { right: 20px; }
html[dir="ltr"] .side-info-container { left: 20px; }

.side-main-btn {
    background: linear-gradient(135deg, #9333ea, #6b21a8);
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.4);
    transition: background 0.3s ease, transform 0.2s ease;
}

.menu-icon-symbol {
    font-size: 16px;
    font-weight: bold;
}

.side-main-btn:hover {
    background: linear-gradient(135deg, #a855f7, #7e22ce);
    transform: scale(1.05);
}

.arrow-icon {
    font-size: 8px;
    transition: transform 0.3s ease;
}

.side-submenu {
    position: absolute;
    top: 125%;
    background: rgba(26, 11, 46, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    width: 190px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: fadeInSubSide 0.3s ease;
}

html[dir="rtl"] .side-submenu { right: 0; text-align: right; }
html[dir="ltr"] .side-submenu { left: 0; text-align: left; }

@keyframes fadeInSubSide {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.submenu-header-title {
    padding: 10px 15px 4px 15px;
    color: #d8b4fe;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
}

.submenu-divider {
    height: 1px;
    background: rgba(168, 85, 247, 0.4);
    margin: 4px 10px 8px 10px;
}

.side-submenu-item {
    padding: 10px 15px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.side-submenu-item:hover {
    background: rgba(147, 51, 234, 0.4);
}

.submenu-group {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

.side-submenu-title {
    padding: 8px 15px;
    color: #c084fc;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.side-submenu-subitem {
    padding: 6px 15px 6px 25px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 12px;
    display: block;
    transition: background 0.2s ease, color 0.2s ease;
}

html[dir="ltr"] .side-submenu-subitem {
    padding: 6px 25px 6px 15px;
}

.side-submenu-subitem:hover {
    background: rgba(147, 51, 234, 0.25);
    color: #ffffff;
}

.side-info-container.active .side-submenu {
    display: flex;
}

.side-info-container.active .arrow-icon {
    transform: rotate(180deg);
}

/* الموجات المتحركة في الأسفل */
.wave-container {
    position: relative;
    width: 100%;
    height: 120px;
    margin-top: auto;
    overflow: hidden;
    background: transparent;
    pointer-events: none;
}

.waves {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    min-height: 100px;
    max-height: 150px;
}


.parallax > use {
    animation: move-wave 25s cubic-bezier(.55,.5,.45,.5) infinite;
}

.parallax > use:nth-child(1) { animation-delay: -2s; animation-duration: 7s; fill: rgba(56, 189, 248, 0.15); }
.parallax > use:nth-child(2) { animation-delay: -3s; animation-duration: 10s; fill: rgba(2, 132, 199, 0.2); }
.parallax > use:nth-child(3) { animation-delay: -4s; animation-duration: 13s; fill: rgba(56, 189, 248, 0.25); }
.parallax > use:nth-child(4) { animation-delay: -5s; animation-duration: 20s; fill: var(--primary-color); opacity: 0.3; }

@keyframes move-wave {
    0% { transform: translate3d(-90px, 0, 0); }
    100% { transform: translate3d(85px, 0, 0); }
}

/* التجاوب مع الهواتف */
@media (max-width: 768px) {
    .article-container {
        margin: -20px 15px 30px 15px;
        padding: 20px;
    }
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .coach-card {
        flex-direction: column;
        text-align: center;
    }
}

/* زر الانتقال للأعلى */
#scrollToTopBtn {
    position: fixed;
    bottom: 95px;
    left: 25px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

#scrollToTopBtn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#scrollToTopBtn:hover {
    transform: translateY(-3px) scale(1.05);
}