    * {
        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;
    }

: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: #ffffff;
    --card-shadow: 0 10px 30px rgba(94, 23, 235, 0.15);
    --glow-sun: #ffa500;
    --glow-moon: #87ceeb;
    --success: #28a745;
    --danger: #dc3545;
    --light-gray: #f5f5f5;
    --nav-bg: #ffffff;
    --sidebar-bg: #f0f2f5;
    --footer-bg: var(--secondary-color);
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 10px;
    --post-bg: #ffffff;
    --gold: #FFD700;
    --silver: #C0C0C0;
    --bronze: #CD7F32;
}

.dark-theme {
    --text-color: #f8f9fa;
    --light-bg: #1E1E1E;
    --dark-bg: #f5f5f5;
    --scrollbar-thumb: var(--secondary-color);
    --scrollbar-track: #333;
    --card-bg: #242526;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --success: #2ecc71;
    --danger: #e74c3c;
    --light-gray: #333333;
    --nav-bg: #242526;
    --sidebar-bg: #18191a;
    --footer-bg: var(--secondary-color);
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.4);
    --post-bg: #3a3b3c;
}


    body {
        background-color: var(--sidebar-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(--nav-bg);
        color: var(--text-color);
        padding: 0.8rem 0;
        position: fixed;
        width: 100%;
        top: 0;
        z-index: 1000;
        box-shadow: var(--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-gray);
        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-gray);
        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);
    }
    
    .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(--shadow-hover);
        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);
        }
    }

    .notifications-popup {
        width: 380px;
    }

    .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-gray);
        color: var(--accent-color);
    }

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

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

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

    .popup-item.unread {
        background: rgba(94, 23, 235, 0.15);
        border-left: 3px solid var(--accent-color);
    }

    .popup-item img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
    }

    .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;
    }

    .popup-time {
        font-size: 0.75rem;
        color: #999;
        white-space: nowrap;
    }

    .no-notifications {
        text-align: center;
        padding: 30px 0;
    }

    .no-notifications i {
        font-size: 3rem;
        color: #ddd;
        margin-bottom: 15px;
    }

    .no-notifications p {
        color: #777;
    }

    .user-menu-popup .popup-item {
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .user-menu-popup .popup-item:hover {
        background: var(--primary-color);
        color: white;
    }

    .user-menu-popup .popup-item:hover p {
        color: white;
    }

    .sidebar {
        background: var(--card-bg);
        border-radius: var(--border-radius);
        padding: 20px;
        box-shadow: var(--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;
    }

    /* زر تبديل السمة الجديد */
    .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;
    }

    .medal {
        display: inline-block;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        margin-left: 5px;
    }

    .gold {
        background: var(--gold);
    }

    .silver {
        background: var(--silver);
    }

    .bronze {
        background: var(--bronze);
    }
    
    .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(--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;
    }
    
    .info-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
        margin-top: 15px;
    }
    
    .info-item {
        display: flex;
        padding: 15px;
        background: var(--light-gray);
        border-radius: var(--border-radius);
    }
    
    .info-label {
        font-weight: 600;
        min-width: 120px;
        color: #555;
    }
    
    .info-value {
        flex: 1;
        font-weight: 500;
    }
    
    .security-warning {
        background: rgba(220, 53, 69, 0.1);
        border-left: 4px solid var(--danger);
        border-radius: var(--border-radius);
        padding: 20px;
        margin-bottom: 25px;
        display: flex;
        align-items: flex-start;
        gap: 15px;
    }

    .security-warning i {
        color: var(--danger);
        font-size: 1.5rem;
        flex-shrink: 0;
        margin-top: 3px;
    }

    .security-warning-content strong {
        color: var(--danger);
        font-weight: 700;
    }

    .security-warning-content p {
        margin-top: 10px;
    }

    .device-card {
        background: var(--light-gray);
        border-radius: var(--border-radius);
        padding: 20px;
        margin-bottom: 20px;
        position: relative;
    }

    .device-card.active {
        border-left: 4px solid var(--success);
    }

    .device-card.inactive {
        border-left: 4px solid #999;
    }

    .device-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
    }

    .device-name {
        font-weight: 700;
        font-size: 1.2rem;
    }

    .device-status {
        padding: 5px 12px;
        border-radius: 20px;
        font-size: 0.85rem;
        font-weight: 600;
    }

    .status-active {
        background: rgba(40, 167, 69, 0.15);
        color: var(--success);
    }

    .status-inactive {
        background: rgba(108, 117, 125, 0.15);
        color: #6c757d;
    }

    .device-info {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
        margin-top: 10px;
    }

    .device-info-item {
        display: flex;
        flex-direction: column;
    }

    .device-info-label {
        font-size: 0.9rem;
        color: #777;
        margin-bottom: 5px;
    }

    .device-info-value {
        font-weight: 600;
    }

    .device-actions {
        margin-top: 15px;
        display: flex;
        gap: 10px;
    }

    .device-action-btn {
        padding: 8px 15px;
        border-radius: 6px;
        background: var(--card-bg);
        border: 1px solid #ddd;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 0.9rem;
    }

    .device-action-btn:hover {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }

    .device-action-btn.logout {
        background: rgba(220, 53, 69, 0.1);
        border-color: rgba(220, 53, 69, 0.2);
        color: var(--danger);
    }

    .device-action-btn.logout:hover {
        background: var(--danger);
        color: white;
    }

    .security-settings {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }

    .setting-card {
        background: var(--light-gray);
        border-radius: var(--border-radius);
        padding: 20px;
        transition: all 0.3s ease;
    }

    .setting-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-hover);
    }

    .setting-header {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 15px;
    }

    .setting-icon {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: var(--primary-color);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.3rem;
    }

    .setting-title {
        font-weight: 700;
        font-size: 1.1rem;
    }

    .setting-desc {
        color: #666;
        margin-bottom: 15px;
        font-size: 0.95rem;
    }

    .setting-action {
        display: flex;
        justify-content: flex-end;
    }

    .setting-btn {
        padding: 8px 20px;
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.3s ease;
        font-weight: 600;
    }

    .setting-btn:hover {
        background: var(--secondary-color);
    }

    .toggle-switch {
        position: relative;
        display: inline-block;
        width: 60px;
        height: 30px;
    }

    .toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    .toggle-slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ccc;
        transition: .4s;
        border-radius: 34px;
    }

    .toggle-slider:before {
        position: absolute;
        content: "";
        height: 22px;
        width: 22px;
        left: 4px;
        bottom: 4px;
        background-color: white;
        transition: .4s;
        border-radius: 50%;
    }

    input:checked + .toggle-slider {
        background-color: var(--success);
    }

    input:checked + .toggle-slider:before {
        transform: translateX(30px);
    }

    @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;
        }
        
        .notifications-popup {
            width: 320px;
        }
        
        .theme-toggle {
            transform: scale(0.9);
        }
        
        .info-grid {
            grid-template-columns: 1fr;
        }
    }

    @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;
        }
        
        .notifications-popup {
            width: calc(100% - 40px);
        }
    }
