/* Global CSS Variables */
:root {
    /* Colors */
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #38bdf8;
    /* Cyan */
    --accent-secondary: #818cf8;
    /* Indigo */
    --border-color: rgba(148, 163, 184, 0.1);

    /* Spacing */
    --sidebar-width: 300px;
    --container-padding: 2rem;

    /* Typography */
    --font-main: 'Inter', sans-serif;
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-secondary);
}

ul {
    list-style: none;
}

/* Layout Structure */
#app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    position: fixed;
    height: 100vh;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 100;
}

.profile-section {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    /* Fix for head cropping */
    border: 3px solid var(--accent-primary);
    margin-bottom: 1rem;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.nav-menu {
    flex-grow: 1;
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(5px);
}

.nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 8px;
    color: var(--accent-primary);
}

.lang-switch-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    background: transparent;
    transition: all 0.2s;
}

.lang-btn.active,
.lang-btn:hover {
    background: var(--accent-primary);
    color: #0f172a;
    border-color: var(--accent-primary);
    font-weight: bold;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 4rem;
    /* max-width removed to allow children to center themselves */
}

/* Center Content Blocks */
section,
footer {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

section {
    margin-bottom: 5rem;
    scroll-margin-top: 2rem;
}

/* Sidebar Profile Image Fix */
.profile-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    /* Fix for head cropping */
    border: 3px solid var(--accent-primary);
    margin-bottom: 1rem;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

/* OSS Contribution Cards Fixes */
.contrib-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Better alignment for multi-line titles */
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.contrib-stars {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    /* Prevent wrapping */
    flex-shrink: 0;
    /* Don't shrink the badge */
}

/* CTA Button Styling */
.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #0f172a;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
    color: #0f172a;
    /* Keep text dark */
}

.cta-button i {
    margin-right: 0.5rem;
}



.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
}

/* Cards & Grid Systems */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(56, 189, 248, 0.3);
}

/* Experience Timeline */
.timeline-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 2.5rem;
    border-left: 2px solid var(--border-color);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-primary);
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timeline-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.timeline-company {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1rem;
}

/* Skills Tags */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

/* OSS Contribution Cards */
.contrib-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.contrib-stars {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.contrib-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.pr-list li {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.pr-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-secondary);
}

/* Projects / Portfolio */
.project-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.project-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent-secondary);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1.5rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .main-content {
        margin-left: 0;
        padding: 2rem 1.5rem;
    }

    .nav-menu {
        display: flex;
        overflow-x: auto;
        padding-bottom: 1rem;
        gap: 0.5rem;
    }

    .nav-link {
        white-space: nowrap;
        margin-bottom: 0;
    }
}

/* QR Code Container in Sidebar */
.qr-container {
    margin-top: 2rem;
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px dashed var(--border-color);
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.qr-container:hover {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.qr-container img {
    width: 140px;
    height: 140px;
    border-radius: 4px;
    border: 4px solid white;
    /* Ensure white border for scanning contrast */
    margin-bottom: 0.75rem;
    transition: transform 0.3s ease;
}

.qr-container:hover img {
    transform: scale(1.05);
}

.qr-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
    /* Center in sidebar */
}

/* Align left in About section */
#about .social-links {
    justify-content: flex-start;
    margin-top: 1.5rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 1.2rem;
    border: 1px solid var(--border-color);
}

.social-icon:hover {
    background: var(--accent-primary);
    color: #0f172a;
    transform: translateY(-3px);
    border-color: var(--accent-primary);
}