/* Base Reset & Variables */
:root {
    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --secondary: #0d9488; /* Teal */
    --tertiary: #9333ea; /* Purple */
    --success: #22c55e;
    --danger: #ef4444;
    
    --bg-body: #0f172a; /* Slate 900 */
    --bg-surface: #1e293b; /* Slate 800 */
    --bg-card: rgba(30, 41, 59, 0.7); /* Glassy Slate 800 */
    
    --text-main: #f8fafc; /* Slate 50 */
    --text-muted: #94a3b8; /* Slate 400 */
    
    --border-color: rgba(148, 163, 184, 0.1);
    
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    
    --sidebar-width: 280px;
    --header-height: 70px; /* Mobile header */
    
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
    color: var(--text-main);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; position: relative; padding-bottom: 0.5rem; }
h3 { font-size: 1.25rem; }
p { margin-bottom: 1rem; color: var(--text-muted); }
a { color: var(--primary); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--primary-hover); }

/* Layout Grid */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform var(--transition-medium);
}

.profile-section {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    margin-bottom: 1rem;
    transition: transform var(--transition-medium);
}

.profile-img:hover {
    transform: scale(1.05);
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.profile-role {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.nav-links {
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-link svg {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.nav-link.control-link:hover, .nav-link.control-link.active {
    background-color: rgba(13, 148, 136, 0.1);
    color: var(--secondary);
}

.nav-link.ai-link:hover, .nav-link.ai-link.active {
    background-color: rgba(147, 51, 234, 0.1);
    color: var(--tertiary);
}

.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    text-align: center;
    color: var(--text-muted);
}

/* Main Content Styling */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem;
    max-width: 1400px; /* Prevent over-stretch on ultra-wide */
}

/* Section Styling */
.section {
    margin-bottom: 4rem;
    scroll-margin-top: 2rem;
    opacity: 0; /* For animation */
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
}

.section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--primary), transparent);
    margin-left: 1.5rem;
    opacity: 0.5;
}

.section-software .section-header::after { background: linear-gradient(to right, var(--primary), transparent); }
.section-control .section-header::after { background: linear-gradient(to right, var(--secondary), transparent); }
.section-ai .section-header::after { background: linear-gradient(to right, var(--tertiary), transparent); }

/* Card Styling */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background-color: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-color: rgba(99, 102, 241, 0.2);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
}

/* Detail Lists within cards */
.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Experience Layout */
.experience-item {
    padding-left: 1.5rem;
    border-left: 2px solid var(--border-color);
    margin-bottom: 2rem;
    position: relative;
    transition: border-color var(--transition-fast);
}

.experience-item::before {
    content: '';
    position: absolute;
    left: -6px; /* 2px border width + 4px radius = 6px offset for center */
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--bg-body);
    border: 2px solid var(--border-color);
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.experience-item:hover {
    border-left-color: var(--primary);
}

.experience-item:hover::before {
    border-color: var(--primary);
    background-color: var(--primary);
}

.experience-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.exp-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* Download Button */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
    color: white;
}

.btn-download.teal {
    background: linear-gradient(135deg, var(--secondary), #0f766e);
    box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.2);
}

/* Contact Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-input, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-main);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    font-family: inherit;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Mobile Toggle */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
}

/* Responseiveness */
@media (max-width: 1024px) {
    .main-content {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 300px;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: calc(var(--header-height) + 2rem) 1rem 2rem 1rem;
    }

    .mobile-header {
        display: flex;
    }
    
    .overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 40;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition-fast);
    }
    
    .overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}

/* Utilities */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-tertiary { color: var(--tertiary); }
.bg-surface { background-color: var(--bg-surface); padding: 1.5rem; border-radius: 1rem; border: 1px solid var(--border-color); }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.flex-col-gap { display: flex; flex-direction: column; gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media(max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
