:root {
    --primary-color: #5E17EB;
    --secondary-color: #8A2BE2;
    --accent-color: #4B0082;
    --gold-color: #FFD700;
    --light-gold: #FFF8DC;
    --text-color: #333;
    --light-text: #f8f9fa;
    --dark-bg: #1E1E1E;
    --light-bg: #f5f5f5;
    --science-color: #3CB371;
    --blue-accent: #4169E1;
    --pink-accent: #C71585;
    --scrollbar-thumb: var(--primary-color);
    --scrollbar-track: #f1f1f1;
    --cell-color: #a5d8ff;
    --dna-color: #9370DB;
    --card-bg: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    --card-shadow: 0 10px 30px rgba(94, 23, 235, 0.15);
    --glow-sun: #ffa500;
    --glow-moon: #87ceeb;
    --success: #3CB371;
    --danger: #e63946;
    --border-radius: 10px;
}

.dark-theme {
    --text-color: #f8f9fa;
    --light-bg: #1E1E1E;
    --dark-bg: #f5f5f5;
    --scrollbar-thumb: var(--secondary-color);
    --scrollbar-track: #333;
    --card-bg: linear-gradient(135deg, #2d2d2d 0%, #252525 100%);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --light-bg: #2b2b2b;
    --card-bg: #2b2b2b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

body {
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.dashboard-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    max-width: 1200px;
    margin: 80px auto 30px;
    padding: 0 20px;
}

header {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 0.8rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: var(--card-shadow);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 800;
}

.logo span {
    color: var(--accent-color);
}

.logo .crown-icon {
    color: var(--gold-color);
    margin-left: 8px;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.nav-icons {
    display: flex;
    gap: 0.8rem;
}

.nav-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-icon:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.user-profile:hover {
    background: var(--light-bg);
    transform: translateY(-2px);
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.user-profile:hover img {
    border-color: var(--primary-color);
}

/* زر تبديل السمة الجديد */
.theme-toggle {
    position: relative;
    width: 70px;
    height: 35px;
    background: linear-gradient(45deg, #ffd700, #ffed4a);
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.theme-toggle:hover {
    transform: scale(1.05);
}

.theme-toggle .toggle-circle {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 27px;
    height: 27px;
    background: white;
    border-radius: 50%;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.theme-toggle .icon {
    font-size: 16px;
    transition: all 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.theme-toggle .sun-icon {
    color: #ff6b35;
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle .moon-icon {
    color: #4a5568;
    position: absolute;
    opacity: 0;
    transform: rotate(180deg) scale(0.5);
}

.theme-toggle .sun-rays {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.theme-toggle.dark {
    background: linear-gradient(45deg, #4a5568, #2d3748);
    box-shadow: 0 5px 15px rgba(74, 85, 104, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.theme-toggle.dark .toggle-circle {
    right: 39px;
    background: #2d3748;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.theme-toggle.dark .sun-icon {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
}

.theme-toggle.dark .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: var(--glow-moon);
}

.theme-toggle.dark .sun-rays {
    opacity: 0;
}

.nav-controls-desktop {
    display: flex;
    align-items: center;
    gap: 20px;
}

.popup {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 350px;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    z-index: 1100;
    padding: 15px;
    display: none;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.popup.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: popup-appear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popup-appear {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.popup-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.popup-title i {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 50%;
}

.popup-title i:hover {
    background: var(--light-bg);
    color: var(--accent-color);
}

.popup-content {
    padding: 10px 0;
}

.popup-item {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    text-decoration: none;
    color: inherit;
}

.popup-item:hover {
    background: rgba(94, 23, 235, 0.1);
    transform: translateX(-3px);
    border-left: 3px solid var(--primary-color);
}

.popup-text {
    flex: 1;
    min-width: 0;
}

.popup-text h4 {
    font-size: 1rem;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popup-text p {
    font-size: 0.85rem;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--card-shadow);
    height: fit-content;
    position: sticky;
    top: 90px;
}

.profile-info {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.profile-title {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 15px;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: #777;
}

.sidebar-links {
    list-style: none;
}

.sidebar-links li {
    margin-bottom: 10px;
}

.sidebar-links a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-links a i {
    margin-left: 10px;
    font-size: 1.2rem;
}

.sidebar-links a:hover, .sidebar-links a.active {
    background: var(--primary-color);
    color: white;
}

.profile-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--card-shadow);
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.help-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.help-banner h2 {
    margin-bottom: 15px;
    font-size: 2rem;
}

.help-banner p {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
    opacity: 0.9;
}

.help-search {
    position: relative;
    margin: 25px 0;
}

.help-search input {
    width: 100%;
    padding: 15px 20px;
    border-radius: 50px;
    border: 2px solid var(--light-bg);
    font-size: 1rem;
    background: var(--light-bg);
    transition: all 0.3s ease;
}

.help-search input:focus {
    border-color: var(--primary-color);
    background: var(--card-bg);
    outline: none;
    box-shadow: 0 0 0 3px rgba(94, 23, 235, 0.2);
}

.help-search button {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    font-size: 1.2rem;
}

.faq-container {
    margin-top: 30px;
}

.faq-item {
    background: var(--light-bg);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    overflow: hidden;
    border-left: 4px solid var(--primary-color);
}

.faq-question {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
}

.faq-question i {
    transition: transform 0.3s ease;
}

.faq-question.active i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer-content {
    padding: 0 0 20px;
}

.faq-answer p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.faq-answer ul {
    padding-right: 20px;
    margin-bottom: 15px;
}

.faq-answer li {
    margin-bottom: 10px;
}

.help-contact {
    background: var(--light-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-top: 30px;
    text-align: center;
    border-left: 4px solid var(--accent-color);
}

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

.contact-button {
    padding: 12px 25px;
    border-radius: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.contact-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.contact-button.whatsapp {
    background: #25D366;
}

.contact-button.email {
    background: var(--accent-color);
}

.contact-button.support {
    background: var(--science-color);
}

@media (max-width: 992px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: relative;
        top: 0;
    }
    
    .nav-icons {
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 10px;
    }
    
    .nav-controls {
        gap: 10px;
    }
    
    .nav-icons {
        gap: 0.3rem;
    }
    
    .nav-icon {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .logo .crown-icon {
        font-size: 1.3rem;
    }
    
    .popup {
        width: 300px;
        right: 10px;
    }
    
    .theme-toggle {
        transform: scale(0.9);
    }
}

@media (max-width: 576px) {
    .nav-icons {
        display: flex;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .theme-toggle {
        transform: scale(0.8);
    }
    
    .user-profile img {
        width: 35px;
        height: 35px;
    }
    
    .popup {
        width: calc(100% - 40px);
        right: 20px;
        max-height: 70vh;
    }
    
    .contact-buttons {
        flex-direction: column;
        align-items: center;
    }
}
