:root {
    --bg-base: #0a0f1c;
    --bg-surface: rgba(17, 24, 39, 0.6);
    --bg-surface-hover: rgba(31, 41, 55, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary: #38bdf8;
    --secondary: #818cf8;
    --accent: #10b981;
    --glow-primary: rgba(56, 189, 248, 0.2);
    --glow-secondary: rgba(129, 140, 248, 0.15);
    
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

[dir="rtl"] {
    direction: rtl;
    font-family: 'Vazirmatn', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Effects */
.background-mesh {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image: 
        linear-gradient(to right, rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
}

.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.5;
    pointer-events: none;
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--glow-primary), transparent 70%);
}

.glow-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--glow-secondary), transparent 70%);
}

/* Layout */
.layout-container {
    display: flex;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    min-height: 100vh;
}

/* Left Panel */
.profile-panel {
    flex: 0 0 400px;
    padding: 40px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.profile-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.avatar-placeholder {
    width: 90px;
    height: 90px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px var(--glow-primary);
}

.name {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}

.title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.tagline {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: auto; /* Pushes lang switcher down */
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s;
    word-break: break-all;
}

.icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    transition: all 0.2s;
    flex-shrink: 0;
}

.contact-link:hover {
    color: var(--text-main);
}

.contact-link:hover .icon-box {
    background: var(--primary);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--glow-primary);
}

.lang-switcher {
    display: flex;
    gap: 10px;
    margin-top: 32px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.lang-btn.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

/* Right Panel */
.content-panel {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.section {
    padding: 40px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-color), transparent);
}

[dir="rtl"] .section-title::after {
    background: linear-gradient(270deg, var(--border-color), transparent);
}

.section-text {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Timeline / Experience */
.experience-section {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.experience-section .section-title {
    padding: 0 40px;
}

.timeline-item {
    margin-bottom: 24px;
}

.timeline-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    background: var(--bg-surface-hover);
}

.tl-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.tl-date {
    color: var(--primary);
    background: rgba(56, 189, 248, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.tl-company {
    color: var(--text-muted);
}

.tl-role {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.tl-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Skills & Tags */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-tags span {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    transition: all 0.2s;
}

.tech-tags span:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    background: rgba(129, 140, 248, 0.1);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.skill-category h4 {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 16px;
    font-weight: 600;
}

/* Certifications */
.cert-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cert-list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.cert-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    flex-shrink: 0;
}

.cert-list strong {
    display: block;
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.cert-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

/* Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .layout-container {
        flex-direction: column;
    }

    .profile-panel {
        flex: none;
        width: 100%;
        height: auto;
        position: relative;
        padding: 20px;
    }

    .profile-card {
        padding: 30px;
        align-items: center;
        text-align: center;
    }

    .content-panel {
        padding: 20px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .contact-info {
        align-items: center;
    }

    .contact-link {
        justify-content: center;
    }

    .lang-switcher {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .section {
        padding: 24px;
    }
    
    .tl-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .contact-link span {
        font-size: 0.85rem;
    }
}