/* --- CSS Variables --- */
/* Defines the color scheme for the dark theme */
:root {
            --bg-primary: #1A1A1A; /* Deep Dark Gray */
            --bg-secondary: #252525; /* Surface/Card Background */
            --bg-card: #303030; /* Hover/Active Surface */
            --text-primary: #E0E0E0; /* High-emphasis text */
            --text-secondary: #B0B0B0; /* Body text */
            --accent-text: #E0E0E0; /* Text on colored backgrounds */
            --border: rgba(255, 255, 255, 0.1); /* Slightly more visible border */
            --shadow: 0 4px 20px rgba(0, 0, 0, 0.3); /* Adjusted shadow for dark bg */
        }

        [data-theme="light"] { /* Overrides variables for the light theme */
            --bg-primary: #ffffff;
            --bg-secondary: #fafcff;
            --bg-card: #e9eff5;
            --text-primary: #575859;
            --text-secondary: #575859;
            --accent-text: #575859;
            --border: rgba(0, 0, 0, 0.1);
            --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
        }

        /* --- Global Styles --- */
        /* Basic reset for all elements */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        /* Default styles for the body */
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            line-height: 1.6;
            transition: all 0.3s ease;
        }

        /* --- Sidebar Styles --- */
        .sidebar {
            position: fixed;
            left: 0;
            top: 0;
            width: 280px;
            height: 100vh;
            background: var(--bg-secondary);
            border-right: 1px solid var(--border);
            padding: 2rem 0;
            overflow-y: auto;
            z-index: 1000;
            transition: all 0.3s ease;
        }
        /* Profile section within the sidebar */
        .profile {
            text-align: center;
            padding: 0 2rem 2rem;
            border-bottom: 1px solid var(--border);
            margin-bottom: 2rem;
        }

        /* Wrapper for the profile image to create the gradient border */
        .profile-img-wrapper {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            background: var(--text-secondary);
            margin: 0 auto 1rem;
            padding: 1px; /* This creates the border thickness */
        }

        /* The actual profile image */
        .profile-img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover; /* Ensures the image covers the circle without distortion */
            display: block; /* Removes any extra space below the image */
        }

        /* Name and subtitle in the profile section */
        .profile h1 {
            font-size: 1.5rem;
            margin-bottom: 0.5rem;
            color: var(--text-primary);
        }

        .profile p {            
            color: var(--text-secondary);
            font-style: italic;
        }

        /* Navigation menu styles */
        .nav-menu {
            list-style: none;
            padding: 0 1rem;
        }

        .nav-item {
            margin-bottom: 0.5rem;
        }

        /* Individual navigation links */
        .nav-link {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem;            
            color: var(--text-secondary);
            text-decoration: none;
            border-radius: 8px;
            transition: all 0.3s ease;
        }

        /* Make nav link text bold */
        .nav-link span {
            font-weight: 600;
        }

        /* Set icon size within the nav link to match the theme toggle button */
        .nav-link i {
            font-size: 1rem;
            width: 1.2em; /* Ensures consistent spacing for different icons */
        }

        /* Hover effect for navigation links */
        .nav-link:hover {
            background: var(--bg-card);
            color: var(--accent-text);
        }

        /* Style for the currently active navigation link */
        .nav-link.active {
            background: var(--text-primary);
            color: var(--bg-secondary);
        }

        /* --- Sidebar Footer --- */
        .sidebar-footer {
            position: absolute;
            bottom: 6rem; /* Position it above the theme toggle button */
            left: 0;
            width: 100%;
            text-align: center;
            padding: 0 1rem;
            font-size: 0.8rem;
            color: var(--text-secondary);
            opacity: 0.6;
        }

        /* --- Theme Toggle Button --- */
        .theme-toggle {
            position: absolute;
            bottom: 2rem;
            left: 50%;
            transform: translateX(-50%);
            background: var(--text-primary);
            color: var(--bg-secondary);
            border: none;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1rem;
            transition: all 0.3s ease;
        }
        /* Hover effect for the theme toggle button */
        .theme-toggle:hover {
            background: var(--text-primary);
            transform: translateX(-50%) scale(1.1);
        }

        /* Specific override for theme toggle button in light mode */
        [data-theme="light"] .theme-toggle {
            background: #575859;
            color: #ffffff;
        }

        /* --- Main Content Area --- */
        /* The main container that holds the page content */
        .main-content {
            margin-left: 280px;
            min-height: 100vh;
            background: var(--bg-primary);
            transition: all 0.3s ease;
        }

        /* Base style for a page section (hidden by default) */
        .page {
            display: none;
            padding: 2rem;
            max-width: 1200px;
            margin: 0 auto;
        }

        /* Style for the currently visible page */
        .page.active {
            display: block;
        }

        /* --- Home Page Specific Styles --- */
        /* The main hero/welcome section */
        .hero {
            text-align: center;
            padding: 4rem 0;
            border-bottom: 1px solid var(--border);
            margin-bottom: 3rem;
        }

       /* Main title and paragraph in the hero section */
       .hero h1 {
            font-size: 3rem;
            margin-bottom: 1rem;
        }

        .hero p {
            font-size: 1.2rem;
            color: var(--text-secondary);
            max-width: 600px;
            margin: 0 auto;
        }

        /* --- Hero Action Buttons --- */
        .hero-actions {
            margin-top: 2rem;
            display: flex;
            justify-content: center;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .action-btn {
            padding: 0.6rem 1.2rem;
            border-radius: 8px;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            font-family: inherit; /* Ensures buttons and links use the same font */
            font-size: 0.9rem;
            font-weight: 600;            
            position: relative; /* Needed for tooltip positioning */
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }

        /* Primary Button Style */
        .action-btn.primary {
            background: var(--text-primary);
            color: var(--bg-primary);
        }

        /* Secondary (Outline) Button Style */
        .action-btn.secondary {
            background: transparent;
            color: var(--text-primary);
            border-color: var(--text-primary);
        }

        .action-btn:hover {
            transform: translateY(-3px);
            opacity: 0.9;
        }

        .action-btn.secondary:hover {
            background: var(--text-primary);
            color: var(--bg-primary);
            opacity: 1;
        }

        /* Tooltip for copy feedback */
        .action-btn .tooltip {
            position: absolute;
            bottom: 125%; /* Position above the button */
            left: 50%;
            transform: translateX(-50%);
            background-color: var(--text-primary);
            color: var(--bg-primary);
            padding: 0.3rem 0.6rem;
            border-radius: 4px;
            font-size: 0.8rem;
            white-space: nowrap;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.2s ease, visibility 0.2s ease;
            z-index: 10;
        }
        .action-btn .tooltip.visible {
            opacity: 1;
            visibility: visible;
        }

        /* --- Skills Section --- */
        .skills-section {
            padding: 2rem 0;
        }

        .section-title {
            text-align: center;
            font-size: 2rem;
            margin-bottom: 2rem;
            color: var(--text-primary);
        }

        .section-subtitle {
            text-align: center;
            color: var(--text-secondary);;
            margin-top: -1.5rem;
            margin-bottom: 2rem;
        }

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

        .skill-item {
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.2rem 0.5rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 1rem;
            text-align: center;
            transition: all 0.3s ease;
        }

        .skill-item:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow);
            background: var(--bg-card);
        }

        .skill-item i {
            font-size: 3rem;
            color: var(--text-primary);
        }

        .skill-item span {
            font-weight: 600;
        }

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

        .project-card {
            position: relative; /* Needed for absolute positioning of the number */
            background: var(--bg-secondary);
            border: 1px solid var(--border);;
            border-radius: 12px;
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .project-card-body {
            display: flex;
            flex-direction: column;
            height: 100%;
            padding: 1.5rem;
            align-items: center;
            text-align: center;
        }

        .project-card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow);
            background: var(--bg-card);
        }

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

        .project-description {
            color: var(--text-secondary);
            font-size: 0.9rem;
            min-height: 4.3rem; 
            flex-grow: 1; /* This makes the description take up available space */
        }

        .project-tags {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
            justify-content: center;
        }

        .tag {
            color: var(--text-secondary);
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 600;
            transition: background-color 0.3s ease; /* Add transition for smooth color change */
        }

        /* When a project card is hovered, change the background of the tags inside it */
        .project-card:hover .tag {
            background-color: var(--bg-secondary);
        }

        .project-card-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 1rem;
            width: 100%;
        }

        .project-card-number {
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--text-secondary);
            opacity: 0.5;
            flex-shrink: 0; /* Prevents the number from shrinking if tags wrap */
        }

        .section-divider {
            height: 1px;
            background-color: var(--border);
            margin: 3rem 0;
        }

        /* --- Paradigm-specific Tag Styles --- */
        /* Dark Mode Specific Tag Styles */
        [data-theme="dark"] .tag {
            background-color: #3A3A3A;
        }
        [data-theme="dark"] .tag.tag-oop {
            color: #FFB74D; /* Desaturated Orange */
        }
        [data-theme="dark"] .tag.tag-fp {
            color: #CE93D8; /* Desaturated Purple */
        }

        /* Light Mode Specific Tag Styles */
        [data-theme="light"] .tag {
            background-color: var(--bg-card); /* Use the card's hover color as the default */
        }

        [data-theme="light"] .tag.tag-oop {
            color: #e67e22; /* A nice shade of orange */
        }
        [data-theme="light"] .tag.tag-fp {
            color: #9b59b6; /* A nice shade of purple */
        }
        
        /* --- Project Detail Page & Breadcrumbs --- */
        .breadcrumb {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            font-size: 0.9rem;
            color: var(--text-secondary);
        }

        .breadcrumb-link {
            color: var(--text-secondary);
            text-decoration: none;
            transition: color 0.3s ease;
        }

        .breadcrumb-link:hover {
            color: var(--text-primary);
            text-decoration: underline;
        }

        .breadcrumb-current {
            color: var(--text-primary);
            font-weight: 600;
        }

        .project-detail-layout {
            display: flex;
            gap: 3rem;
            align-items: flex-start;
        }

        .project-content {
            flex: 1; /* Takes up the remaining space */
            min-width: 0; /* Prevents flexbox overflow issues */
        }

        .project-content h2 {
            margin-top: 2rem;
            margin-bottom: 1rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--border);
        }

        .project-toc {
            width: 240px;
            flex-shrink: 0;
            position: sticky;
            top: 2rem; /* Stick 2rem from the top */
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.5rem;
        }

        .project-toc h3 {
            font-size: 0.9rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-secondary);
            margin-bottom: 0.5rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--border);
        }

        .project-toc ul {
            list-style: none;
        }

        .project-toc li a {
            display: block;
            padding: 0.75rem 1rem;
            color: var(--text-secondary);
            text-decoration: none;
            border-radius: 8px;
            font-weight: 600;
            transition: all 0.3s ease;
        }

        .project-toc li a:hover {
            background: var(--bg-card);
            color: var(--text-primary);
        }

        /* Style for the active link in the TOC, matching the sidebar */
        .project-toc li a.active {
            background: var(--text-primary);
            color: var(--bg-secondary);
        }

        /* --- Scroll to Top Button --- */
        .scroll-to-top {
            display: block;
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            z-index: 999; /* Below the sidebar overlay */
            background: var(--text-primary);
            color: var(--bg-secondary);
            border: none;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.2rem;
            transition: all 0.3s ease;
            opacity: 0;
            visibility: hidden;
            transform: translateY(20px);
        }

        .scroll-to-top.visible {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .scroll-to-top:hover {
            background: var(--text-primary);
            transform: scale(1.1);
        }

        /* --- Mobile Responsive Styles --- */
        /* The hamburger menu button for mobile */
        .mobile-menu-btn {
            display: none;
            position: fixed;
            top: 1rem;
            left: 1rem;
            z-index: 1001;
            background: var(--text-primary);
            color: var(--bg-secondary);
            border: none;
            width: 50px;
            height: 50px;
            border-radius: 8px;
            font-size: 1.2rem;
            cursor: pointer;
        }
        
        /* Specific override for light mode to match theme toggle */
        [data-theme="light"] .scroll-to-top {
            background: #575859;
            color: #ffffff;
        }

        /* Styles for screens 768px wide or smaller */
        @media (max-width: 768px) {
            .mobile-menu-btn {
                display: block;
            }

            .sidebar {
                transform: translateX(-100%);
                width: 100%;
                max-width: 280px;
            }

            /* Class added by JS to show the sidebar */
            .sidebar.open {
                transform: translateX(0);
            }

            .main-content {
                margin-left: 0;
            }

            .page {
                padding: 1rem;
                padding-top: 5rem;
            }

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

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

            .section-title {
                font-size: 1.5rem;
            }
        }
        
        /* On smaller screens, stack the TOC on top of the content */
        @media (max-width: 1024px) {
            .project-detail-layout {
                flex-direction: column;
            }
            .project-toc {
                position: static; /* Un-stick the TOC */
                width: 100%;
                order: -1; /* Moves the TOC to the top in the flex column */
                margin-bottom: 2rem;
            }
        }

        /* Styles for screens 480px wide or smaller */
        @media (max-width: 480px) {
            .page {
                padding: 0.5rem;
                padding-top: 4rem;
            }

            .hero {
                padding: 2rem 0;
            }

            .hero h1 {
                font-size: 1.5rem;
            }
        }