/* =====================================================
   CSS Variables & Theme Configuration
   ===================================================== */

:root {
    /* Light Mode Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --text-tertiary: #8e8e8e;
    --accent-primary: #0066cc;
    --accent-hover: #0052a3;
    --border-color: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;

    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-medium: 0.3s ease;
}

/* Dark Mode Colors - Applied when checkbox is checked */
body:has(#theme-toggle:checked) {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #161b22;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-tertiary: #6e7681;
    --accent-primary: #4da6ff;
    --accent-hover: #66b3ff;
    --border-color: #30363d;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.4);
}

/* =====================================================
   Reset & Base Styles
   ===================================================== */

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

html {
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-medium), color var(--transition-medium);
}

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

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

ul {
    list-style: none;
}

/* =====================================================
   Theme Toggle
   ===================================================== */

.theme-toggle-checkbox {
    display: none;
}

.theme-toggle-btn {
    position: relative;
    display: block;
    width: 60px;
    height: 30px;
    background-color: var(--border-color);
    border-radius: 30px;
    cursor: pointer;
    transition: background-color var(--transition-medium);
}

.theme-toggle-btn:hover {
    background-color: var(--text-tertiary);
}

.toggle-icon {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background-color: var(--bg-primary);
    border-radius: 50%;
    transition: transform var(--transition-medium);
}

.theme-toggle-checkbox:checked + body .theme-toggle-btn .toggle-icon,
body:has(#theme-toggle:checked) .toggle-icon {
    transform: translateX(30px);
}

/* Sun/Moon icon pseudo-elements */
.toggle-icon::before {
    content: '☀';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
}

body:has(#theme-toggle:checked) .toggle-icon::before {
    content: '☾';
}

/* =====================================================
   Navigation Bar
   ===================================================== */

.navbar {
    position: sticky;
    top: 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-sm) 0;
    z-index: 1000;
    transition: background-color var(--transition-medium), border-color var(--transition-medium), box-shadow var(--transition-medium);
}

.navbar.scrolled {
    box-shadow: 0 2px 10px var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.nav-logo:hover {
    color: var(--accent-primary);
}

.nav-menu {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: all var(--transition-medium);
}

.mobile-nav-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-nav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* =====================================================
   Container & Layout
   ===================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
    text-align: center;
}

/* =====================================================
   Hero Section
   ===================================================== */

.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-md);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.hero-content {
    max-width: 800px;
    text-align: center;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* =====================================================
   Buttons
   ===================================================== */

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
}

.btn-secondary:hover {
    background-color: var(--accent-primary);
    color: #ffffff;
    transform: translateY(-2px);
}

/* =====================================================
   About Section
   ===================================================== */

.about {
    padding: var(--spacing-xl) 0;
    background-color: var(--bg-primary);
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.about-text:last-child {
    margin-bottom: 0;
}

/* =====================================================
   Experience Section
   ===================================================== */

.experience {
    padding: var(--spacing-xl) 0;
    background-color: var(--bg-secondary);
}

.experience-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-lg);
    box-shadow: 0 2px 8px var(--shadow);
    transition: all var(--transition-medium);
}

.experience-card:hover {
    box-shadow: 0 4px 16px var(--shadow-hover);
    transform: translateY(-2px);
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.experience-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.experience-company {
    font-size: 1.125rem;
    color: var(--accent-primary);
    font-weight: 600;
}

.experience-meta {
    text-align: right;
}

.experience-location,
.experience-date {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.experience-projects {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.project-item {
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.project-item:first-child {
    padding-top: 0;
    border-top: none;
}

.project-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.project-highlights {
    list-style: disc;
    margin-left: 1.5rem;
}

.project-highlights li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.project-highlights li:last-child {
    margin-bottom: 0;
}

/* =====================================================
   Projects Section
   ===================================================== */

.projects {
    padding: var(--spacing-xl) 0;
    background-color: var(--bg-primary);
}

.projects-grid {
    margin-top: var(--spacing-lg);
}

/* Override Bootstrap's default row margins for better spacing */
.projects-grid.row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.project-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-md);
    transition: all var(--transition-medium);
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px var(--shadow);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-hover);
    border-color: var(--accent-primary);
}

.project-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.project-date {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-sm);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.7;
}

.project-details {
    list-style: disc;
    margin-left: 1.25rem;
    margin-bottom: var(--spacing-sm);
    flex-grow: 1;
}

.project-details li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: var(--spacing-sm);
}

.tech-badge {
    background-color: var(--bg-secondary);
    color: var(--accent-primary);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.project-card:hover .tech-badge {
    background-color: var(--accent-primary);
    color: #ffffff;
    border-color: var(--accent-primary);
}

.project-link {
    color: var(--accent-primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: all var(--transition-fast);
    margin-top: auto;
}

.project-link:hover {
    color: var(--accent-hover);
    transform: translateX(4px);
}

/* Project Filter */
.project-filter-container {
    margin: var(--spacing-lg) 0;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1.25rem;
    border: 2px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
}

/* =====================================================
   Footer
   ===================================================== */

.footer {
    background-color: var(--bg-secondary);
    padding: var(--spacing-lg) 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

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

.footer-links {
    display: flex;
    gap: var(--spacing-md);
}

.footer-link {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--accent-primary);
}

/* =====================================================
   Responsive Design
   ===================================================== */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--bg-card);
        flex-direction: column;
        padding: 5rem var(--spacing-md) var(--spacing-md);
        gap: var(--spacing-md);
        box-shadow: -5px 0 15px var(--shadow);
        transition: right var(--transition-medium);
        border-left: 1px solid var(--border-color);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: var(--spacing-sm) 0;
        border-bottom: 1px solid var(--border-color);
    }

    body.nav-open {
        overflow: hidden;
    }

    body.nav-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .hero-description {
        font-size: 1.125rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .experience-header {
        flex-direction: column;
    }

    .experience-meta {
        text-align: left;
    }


    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .nav-container {
        padding: 0 var(--spacing-sm);
    }

    .nav-menu {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .hero {
        min-height: 80vh;
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    .experience-card,
    .project-card {
        padding: var(--spacing-sm);
    }
}

/* Large Desktop (1440px and above) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
}
