/* --- Light Mode & Theme Toggle --- */
.light-theme {
    --bg-black: #f8f9fa;
    --text-white: #1a1a1a;
    --text-gray: #4a4a4a;
    --glass: rgba(0, 0, 0, 0.03);
    --glass-border: rgba(0, 0, 0, 0.08);
    --primary-dim: rgba(0, 242, 255, 0.05);
}

.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 2.5rem;
    width: 4.5rem;
    height: 4.5rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10001;
    color: var(--text-white);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.theme-toggle:hover {
    background: var(--primary);
    color: black;
    transform: scale(1.1) rotate(15deg);
}

/* --- Language Switcher --- */
.lang-switcher {
    position: fixed;
    top: 1.5rem;
    right: 8rem;
    z-index: 10001;
    font-family: var(--font-mono);
}

.curr-lang {
    width: 4.5rem;
    height: 4.5rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(15px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-white);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 1rem;
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: none;
    flex-direction: column;
}

.lang-switcher.active .lang-dropdown { display: flex; }
.lang-dropdown div { padding: 1rem 2rem; cursor: pointer; color: var(--text-gray); }
.lang-dropdown div:hover { background: var(--primary); color: #000; }

/* --- Portfolio Filters --- */
.portfolio-filters {
    display: flex;
    gap: 1.5rem;
    margin-top: 3.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-white);
    padding: 1rem 2.5rem;
    border-radius: 100px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.4rem;
    transition: all 0.4s cubic-bezier(0.2, 1, 0.3, 1);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary);
    color: black;
    border-color: var(--primary);
}

/* --- Premium Skill Bars --- */
.skill-item-premium {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 2rem 0 !important;
    border-bottom: 1px solid var(--glass-border);
}

.skill-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 1.6rem;
    font-weight: 600;
}

.skill-info span {
    font-size: 1.1rem;
    color: var(--text-gray);
    text-transform: uppercase;
    font-weight: 700;
}

.skill-bar-container {
    width: 100%;
    height: 6px;
    background: var(--glass-border);
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(to right, var(--primary), var(--accent));
    transition: width 2s cubic-bezier(0.2, 1, 0.3, 1);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* --- Project Card Overlay Improvements --- */
.p-overlay {
    background: linear-gradient(to top, rgba(5, 5, 5, 0.9) 0%, transparent 100%) !important;
    backdrop-filter: blur(4px);
    transition: all 0.5s ease;
}

.p-btn-circle {
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.p-card-v3:hover .p-btn-circle {
    transform: translateY(0);
    opacity: 1;
}

/* --- Cursor Visibility - MAXIMUM Z-INDEX --- */
.cursor-dot, .cursor-outline, .cursor-trail {
    z-index: 1000000 !important; /* رفعه ليكون فوق الـ Lightbox */
}

/* RTL Adjustments for Theme Toggle and Language Switcher */
html[dir="rtl"] .theme-toggle {
    right: auto; /* Remove right positioning */
    left: 2.5rem; /* Position from left */
}

html[dir="rtl"] .lang-switcher {
    right: auto; /* Remove right positioning */
    left: 8rem; /* Position from left */
}

html[dir="rtl"] .lang-switcher .lang-dropdown {
    left: auto; /* Remove left positioning */
    right: 0; /* Align dropdown to the right of the switcher */
}

@media (max-width: 991px) {
    .theme-toggle { right: 1rem; top: 1rem; width: 4.2rem; height: 4.2rem; font-size: 1.9rem; }
    .lang-switcher { right: 6.2rem; top: 1rem; }
    .curr-lang { width: 4.2rem; height: 4.2rem; }

    html[dir="rtl"] .theme-toggle {
        left: 1rem;
        right: auto;
    }
    html[dir="rtl"] .lang-switcher {
        left: 6.2rem;
        right: auto;
    }
}

@media (max-width: 768px) {
    .project-container-v3 { grid-template-columns: 1fr; gap: 2.5rem; }
    .toast { min-width: auto; width: 90vw; right: 5vw; }
}

@media (max-width: 480px) {
    .theme-toggle { right: 0.8rem; top: 0.8rem; width: 3.8rem; height: 3.8rem; font-size: 1.7rem; }
    .lang-switcher { right: 5.4rem; top: 0.8rem; }
    .curr-lang { width: 3.8rem; height: 3.8rem; font-size: 1rem; }

    html[dir="rtl"] .theme-toggle {
        left: 0.8rem;
        right: auto;
    }
    html[dir="rtl"] .lang-switcher {
        left: 5.4rem;
        right: auto;
    }
}