:root {
    --bg-color: #05070e; /* Very dark blue/black */
    --surface-color: rgba(255, 255, 255, 0.03);
    --surface-border: rgba(255, 255, 255, 0.05);
    
    --maroon-primary: #8a1538; /* الخمري */
    --maroon-glow: rgba(138, 21, 56, 0.3);
    --blue-glow: rgba(10, 25, 47, 0.6);
    
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --font-main: 'DIN Next LT Arabic', sans-serif;
    --font-signature: 'Brush Script MT', cursive; /* fallback for signature look */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Background Effects */
.glow-orb {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.5;
}

.glow-maroon {
    background: var(--maroon-glow);
    top: -100px;
    left: -100px;
}

.glow-blue {
    background: var(--blue-glow);
    bottom: -200px;
    right: -100px;
}

/* Utilities */
.glass-panel {
    background: var(--surface-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--maroon-primary);
    border-radius: 50%;
    margin-left: 8px; /* RTL margin */
}

.dot.large {
    width: 16px;
    height: 16px;
}

.section-label {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

/* Layout */
.container {
    display: flex;
    padding: 2rem;
    gap: 3rem;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 320px;
    flex-shrink: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: calc(100vh - 4rem);
    position: sticky;
    top: 2rem;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.status-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    border: 1px solid var(--surface-border);
}

.profile-image {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid var(--surface-border);
    position: relative;
}

.profile-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.profile-image:hover img {
    transform: scale(1.05);
}

.profile-info {
    text-align: center;
    width: 100%;
    margin-bottom: 2rem;
}

.signature-name {
    font-family: var(--font-main);
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    background: linear-gradient(to left, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.email {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.location {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--surface-border);
}

.social-btn:hover {
    background: var(--maroon-primary);
    transform: translateY(-3px);
}

.cta-button {
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    border-radius: 30px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.cta-button i {
    width: 32px;
    height: 32px;
    background: #fff;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.cta-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.cta-button:hover i {
    transform: translateX(-5px); /* RTL direction */
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0; /* allows flex children to shrink/overflow properly */
}

.section-block {
    max-width: 900px;
    margin-bottom: 4rem;
    animation: fadeIn 1s ease forwards;
}

.portfolio-section {
    max-width: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.main-title {
    font-size: 3rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}


.description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skill-badge {
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.skill-badge:hover {
    border-color: var(--maroon-primary);
    color: #fff;
    background: rgba(138, 21, 56, 0.1);
}

/* Stats */
.stats-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 4rem;
}

.stat-card {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 4rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-top: 1rem;
}

/* Portfolio */
.portfolio-header {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.portfolio-header h2 {
    font-size: 2rem;
    font-weight: 400;
}

.portfolio-slider-wrapper {
    position: relative;
    width: 100%;
}

.portfolio-slider {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 1rem;
    scrollbar-width: none; /* Firefox */
}

.portfolio-slider::-webkit-scrollbar {
    display: none; /* Chrome */
}

.portfolio-slider-item {
    width: 75vw;
    max-width: 380px;
    height: 450px;
    border-radius: 20px;
    background-size: 100% auto;
    background-position: top center;
    background-repeat: no-repeat;
    transition: background-position 5s ease-in-out;
    position: relative;
    scroll-snap-align: start;
    flex-shrink: 0;
    border: 1px solid var(--surface-border);
}

.portfolio-slider-item:hover {
    background-position: bottom center;
}

.portfolio-overlay {
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(5,7,14,0.95), transparent);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    opacity: 0;
    transition: all 0.3s ease;
    border-radius: 0 0 20px 20px;
}

.portfolio-slider-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 0;
}

/* Experience */
.experience-title {
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 3rem;
    max-width: 800px;
}

.timeline {
    position: relative;
}

.timeline-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 3rem;
    border-right: 1px solid var(--surface-border); /* RTL */
    padding-right: 2rem; /* RTL */
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: -4px; /* RTL */
    top: 0;
    width: 7px;
    height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.timeline-item:hover::before {
    background: var(--maroon-primary);
    box-shadow: 0 0 10px var(--maroon-primary);
}

.timeline-item:hover .timeline-date {
    background: var(--maroon-primary);
    color: #fff;
    border-color: var(--maroon-primary);
}

.timeline-item:hover h4 {
    color: var(--maroon-primary);
}

.timeline-info h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.timeline-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.timeline-date {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    height: fit-content;
    white-space: nowrap;
    margin-right: 2rem; /* RTL */
    transition: all 0.3s ease;
}

/* Floating Nav */
.floating-nav {
    position: fixed;
    right: 2rem; /* We'll keep it on the left for RTL, or right. Actually in RTL, left side is better if sidebar is right, but here sidebar is right? No, sidebar is in normal flex flow. */
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    padding: 1rem 0.5rem;
    gap: 1rem;
    border-radius: 30px;
    z-index: 100;
}

.nav-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.nav-icon:hover, .nav-icon.active {
    background: #fff;
    color: #000;
}

/* Responsive fixes for RTL */
@media (max-width: 768px) {
    .timeline-item {
        flex-direction: column;
        gap: 0.8rem;
        padding-bottom: 2rem;
    }
    .timeline-date {
        margin-right: 0;
        align-self: flex-start;
    }
}

@media (min-width: 1200px) {
    .floating-nav {
        left: 2rem; /* Move floating nav to left in RTL so it's out of the way of the scrollbar */
        right: auto;
    }
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
    }
    .floating-nav {
        display: none; /* Hide on mobile or make horizontal at bottom */
    }
}
