/*
==============================================
Enhanced Portfolio CSS with Refined Cybersecurity Theme
Full and complete stylesheet with modern animations and effects, focused on professionalism and clarity.
==============================================
*/

/* --- ROOT & GLOBAL STYLES --- */
:root {
    /* Color Palette */
    --primary-dark: #1a73e8; /* Original Primary Blue */
    --secondary-dark: #34a853; /* Original Secondary Green */
    --accent-dark: #fbbc05; /* Original Accent Yellow */

    /* Refined Dark Theme Base */
    --dark-bg: #0d1117; /* GitHub Dark Background */
    --darker-bg: #010409; /* Even Darker Background */
    --card-bg-dark: #161b22; /* GitHub Card Background */
    --text-dark: #e8eaed; /* Light text for dark backgrounds */
    --text-muted-dark: #8b949e; /* Muted text for dark backgrounds */

    /* Refined Light Theme Base */
    --primary-light: #1a73e8;
    --secondary-light: #34a853;
    --accent-light: #fbbc05;
    --light-bg: #f8f9fa; /* Google-like light background */
    --lighter-bg: #ffffff; /* Pure white */
    --card-bg-light: #ffffff;
    --text-light: #202124; /* Dark text for light backgrounds */
    --text-muted-light: #5f6368; /* Muted text for light backgrounds */

    /* Cybersecurity Accent Colors (Subtle & Professional) */
    --cyber-primary-green: #00e676; /* Vibrant but not overpowering green (similar to Material UI green A400) */
    --cyber-secondary-blue: #00b0ff; /* Bright but clean blue (similar to Material UI light blue A400) */
    --cyber-accent-purple: #ab47bc; /* A subtle purple for emphasis */
    --cyber-red: #ff5252; /* For error states or warnings, subtle */

    /* Effects & Transitions */
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smoother bezier curve */
    --border-radius: 8px; /* Slightly less rounded, more modern */
    --box-shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.1);
    --box-shadow-medium: 0 5px 15px rgba(0, 0, 0, 0.2);
    --box-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.3);

    /* Refined Cyber Glows */
    --glow-primary: 0 0 15px rgba(0, 230, 118, 0.4); /* Green glow */
    --glow-secondary: 0 0 15px rgba(0, 176, 255, 0.4); /* Blue glow */
    --glow-text-subtle: 0 0 5px rgba(0, 230, 118, 0.2); /* Subtle green text glow */
    --glow-text-strong: 0 0 10px rgba(0, 230, 118, 0.5); /* Stronger green text glow */
    --glow-card-border: 2px solid var(--cyber-primary-green);
    --glow-card-shadow: 0 0 10px rgba(0, 230, 118, 0.2);

    /* --- For Project Card Glow Effect (Refined) --- */
    --project-glow-opacity: 0;
    --project-glow-x: 0px;
    --project-glow-y: 0px;
}

/* Keyframe Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0); /* Smaller lift */
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); } /* Subtle pulse */
    100% { transform: scale(1); }
}

@keyframes gradient-pan {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Refined text glow animation */
@keyframes text-glow-pulse-refined {
    0% { text-shadow: var(--glow-text-subtle); }
    50% { text-shadow: var(--glow-text-strong); }
    100% { text-shadow: var(--glow-text-subtle); }
}

/* Cursor blink for typing effect */
@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--cyber-primary-green); }
}

/* Subtle background pattern for dark theme */
@keyframes cyber-background-grid {
    0% { background-position: 0 0; }
    100% { background-position: 100% 100%; }
}

/* Scanline effect for contact section */
@keyframes scanlines {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 100%; }
}

/* Global resets and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif; /* Keep Roboto for readability */
    background-color: var(--dark-bg);
    color: var(--text-dark);
    line-height: 1.7; /* Slightly more relaxed line height */
    transition: background-color 0.4s ease, color 0.4s ease;
    /* Subtle cyber background grid */
    background-image:
        linear-gradient(90deg, rgba(0,230,118,0.01) 1px, transparent 1px),
        linear-gradient(180deg, rgba(0,230,118,0.01) 1px, transparent 1px);
    background-size: 25px 25px; /* Larger grid for subtlety */
    animation: cyber-background-grid 120s linear infinite; /* Very slow movement */
}

body.light-theme {
    background-color: var(--light-bg);
    color: var(--text-light);
    background-image: none; /* No pattern in light theme */
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4 {
    font-family: 'Orbitron', sans-serif; /* Keep for headings */
    letter-spacing: 0.5px; /* Less aggressive letter spacing */
    margin-bottom: 1rem;
    color: var(--cyber-primary-green); /* Headings in cyber green */
    text-shadow: var(--glow-text-subtle);
    animation: text-glow-pulse-refined 4s infinite alternate;
}
.light-theme h1, .light-theme h2, .light-theme h3, .light-theme h4 {
    color: var(--primary-light); /* Standard primary blue in light theme */
    text-shadow: none; /* No glow in light theme for professionalism */
    animation: none;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    font-size: 1.05rem; /* Slightly larger text for readability */
}
.light-theme p { color: var(--text-light); }

/* Typing effect specific styles */
.typing-text {
    font-family: 'Share Tech Mono', monospace; /* Monospace for coding feel */
    color: var(--cyber-secondary-blue); /* Neon blue for the "typed" text */
    font-size: 1.7rem; /* Slightly larger for prominence */
    height: 2.5rem;
    display: inline-block;
    text-shadow: 0 0 8px rgba(0, 176, 255, 0.5); /* Blue text glow */
}
.typing-text::after {
    content: '|';
    display: inline-block;
    animation: blink-caret 0.75s step-end infinite;
    color: var(--cyber-primary-green); /* Cursor in cyber green */
    text-shadow: 0 0 5px var(--cyber-primary-green);
}
.light-theme .typing-text { color: var(--primary-light); text-shadow: none; }
.light-theme .typing-text::after { color: var(--primary-light); text-shadow: none; }


/* --- NAVIGATION --- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(180deg, rgba(1, 4, 9, 0.98), rgba(1, 4, 9, 0.9)); /* Darker, more opaque base */
    backdrop-filter: blur(12px); /* Moderate blur */
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Very subtle border */
    transition: all 0.4s ease-in-out;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    /* Refined Cyber border & shadow for nav */
    border-bottom: 2px solid rgba(0, 230, 118, 0.3); /* Subtle green border */
    box-shadow: 0 2px 15px rgba(0, 230, 118, 0.2); /* Subtle green shadow */
}

.light-theme nav {
    background: linear-gradient(180deg, rgba(248, 249, 250, 0.98), rgba(248, 249, 250, 0.9));
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid rgba(26, 115, 232, 0.2);
    box-shadow: 0 2px 15px rgba(26, 115, 232, 0.1);
}

nav.scrolled {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    background: linear-gradient(180deg, rgba(1, 4, 9, 0.99), rgba(1, 4, 9, 0.95)); /* Even more opaque */
    backdrop-filter: blur(18px); /* Slightly more blur */
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.6);
    /* Stronger cyber effect on scroll */
    border-color: rgba(0, 176, 255, 0.5); /* Blue border on scroll */
    box-shadow: 0 5px 25px rgba(0, 176, 255, 0.3); /* Blue shadow on scroll */
}

.light-theme nav.scrolled {
    background: linear-gradient(180deg, rgba(248, 249, 250, 0.99), rgba(248, 249, 250, 0.95));
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(26, 115, 232, 0.3);
    box-shadow: 0 5px 25px rgba(26, 115, 232, 0.2);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    transition: padding 0.4s ease-in-out;
}

.nav-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    color: var(--cyber-primary-green); /* Logo text in cyber green */
    font-family: 'Orbitron', sans-serif;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
    transition: var(--transition);
    text-shadow: var(--glow-text-subtle);
    animation: text-glow-pulse-refined 4s infinite alternate;
}

.light-theme .nav-logo {
    color: var(--primary-light);
    text-shadow: none;
    animation: none;
}

.nav-logo:hover {
    color: var(--cyber-secondary-blue); /* Blue on hover */
    text-shadow: var(--glow-secondary); /* Blue glow on hover */
}
.light-theme .nav-logo:hover {
    color: var(--accent-light);
    text-shadow: none;
}

.nav-logo img {
    height: 40px; /* Slightly smaller image for balance */
    margin-right: 12px;
    border-radius: 50%;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid var(--cyber-primary-green); /* Green border */
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.3); /* Green glow */
}
.light-theme .nav-logo img {
    border: 2px solid var(--primary-light);
    box-shadow: 0 0 8px rgba(26, 115, 232, 0.2);
}

.nav-logo:hover img {
    transform: rotate(360deg) scale(1.08); /* Subtle scale */
    border-color: var(--cyber-secondary-blue); /* Blue border on hover */
    box-shadow: 0 0 18px rgba(0,176,255,0.6); /* Blue glow on hover */
}
.light-theme .nav-logo:hover img {
    border-color: var(--accent-light);
    box-shadow: 0 0 15px rgba(251, 188, 5, 0.4);
}

.nav-links {
    display: flex;
    list-style: none;
}
.nav-links li { margin-left: 2rem; }
.nav-links a {
    text-decoration: none;
    color: var(--text-dark); /* Default text color */
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    padding: 0.5rem 0.8rem; /* More padding for better hover target */
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px; /* Slightly rounded corners */
}
.light-theme .nav-links a { color: var(--text-light); }

/* Refined hover effect for nav links */
.nav-links a:hover {
    color: var(--lighter-bg); /* White text on hover */
    transform: translateY(-2px); /* Subtle lift */
    background: linear-gradient(90deg, var(--cyber-primary-green), var(--cyber-secondary-blue));
    background-size: 200% auto;
    background-position: right center;
    box-shadow: 0 3px 10px rgba(0, 230, 118, 0.4); /* Green shadow */
}
.light-theme .nav-links a:hover {
    color: var(--lighter-bg);
    background: linear-gradient(90deg, var(--primary-light), var(--secondary-light));
    background-position: right center;
    box-shadow: 0 3px 10px rgba(26, 115, 232, 0.3);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    height: 2px; /* Thinner line */
    background: var(--cyber-accent-purple); /* Purple for subtle accent */
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: center;
    opacity: 0;
    filter: blur(1px); /* Very subtle blur */
}
.light-theme .nav-links a::after { background: var(--accent-light); }

.nav-links a:hover::after {
    transform: scaleX(0.8); /* Slightly less than full width for clean look */
    opacity: 1;
}

/* --- THEME TOGGLE --- */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
    background: var(--card-bg-dark);
    border-radius: 50%; /* Perfect circle */
    padding: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--box-shadow-subtle);
    /* Refined cyber toggle styling */
    border: 2px solid var(--cyber-primary-green);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.3);
    background: rgba(0, 230, 118, 0.05); /* Very subtle green tint */
}
.light-theme .theme-toggle {
    background: var(--card-bg-light);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: var(--box-shadow-subtle);
    border: 2px solid var(--primary-light);
    box-shadow: 0 0 10px rgba(26, 115, 232, 0.2);
    background: rgba(26, 115, 232, 0.03);
}
.theme-toggle:hover {
    transform: scale(1.1) rotate(10deg); /* Less aggressive rotation */
    border-color: var(--cyber-secondary-blue); /* Blue border on hover */
    box-shadow: 0 0 20px rgba(0, 176, 255, 0.6); /* Stronger blue glow on hover */
    background: rgba(0, 176, 255, 0.1); /* Subtle blue tint */
}
.light-theme .theme-toggle:hover {
    border-color: var(--primary-light);
    box-shadow: 0 0 20px rgba(26, 115, 232, 0.4);
}
.theme-toggle i {
    font-size: 1.4rem;
    transition: transform 0.4s ease, color 0.4s ease;
    position: absolute;
}
.theme-toggle .sun { color: #fbbc05; transform: scale(0); }
.theme-toggle .moon { color: var(--text-dark); transform: scale(1); }
.light-theme .theme-toggle .sun { transform: scale(1) rotate(360deg); }
.light-theme .theme-toggle .moon { transform: scale(0); }

.mobile-menu-toggle {
    display: none !important;
}

/* --- SECTIONS & CONTAINERS --- */
section {
    min-height: 100vh;
    padding: 8rem 0;
    position: relative;
    scroll-margin-top: 80px;
    overflow: hidden;
}
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.section-content {
    background: var(--card-bg-dark);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-medium);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    /* Refined Cyber section content styling */
    border: var(--glow-card-border);
    box-shadow: var(--glow-card-shadow);
    background: linear-gradient(135deg, var(--card-bg-dark), rgba(0, 230, 118, 0.03)); /* Very subtle gradient */
}
.light-theme .section-content {
    background: var(--card-bg-light);
    border-color: rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(26, 115, 232, 0.2);
    box-shadow: 0 0 10px rgba(26, 115, 232, 0.1);
    background: linear-gradient(135deg, var(--card-bg-light), rgba(26, 115, 232, 0.02));
}
.section-content:hover {
    transform: translateY(-3px); /* Gentle lift */
    box-shadow: 0 0 25px rgba(0, 230, 118, 0.5); /* Stronger green glow on hover */
    border-color: var(--cyber-secondary-blue); /* Border changes to blue on hover */
}
.light-theme .section-content:hover {
    box-shadow: 0 0 25px rgba(26, 115, 232, 0.4);
    border-color: var(--primary-light);
}

/* --- HOME SECTION --- */
#home {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    /* Clean up ::before for a more focused hero */
    background: radial-gradient(circle at 20% 30%, rgba(0,230,118,0.08), transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(0,176,255,0.08), transparent 40%);
    background-size: 200% 200%; /* Larger for smooth pan */
    animation: gradient-pan 40s ease infinite;
    filter: brightness(1.2); /* Slightly brighter for impact */
    z-index: 0; /* Ensures it's behind content */
}
#home::before {
    /* Removed for cleaner look, integrated into #home */
    content: none;
}
.light-theme #home {
    background: radial-gradient(circle at 20% 30%, rgba(26,115,232,0.08), transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(52,168,83,0.08), transparent 40%);
}

#home .section-content {
    padding: 4rem 2rem;
    background: transparent;
    border: none;
    box-shadow: none;
    z-index: 1;
}
#home h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, var(--cyber-primary-green), var(--cyber-secondary-blue), var(--cyber-accent-purple));
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradient-pan 15s linear infinite;
    text-shadow: 0 0 15px rgba(0, 230, 118, 0.6); /* Prominent text shadow for H1 */
}
.light-theme #home h1 {
    background: linear-gradient(90deg, var(--primary-light), var(--secondary-light), var(--accent-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
}


/* --- ABOUT SECTION --- */
.about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.about-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}
.profile-image-container {
    width: 220px; /* Slightly smaller */
    height: 220px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    padding: 5px;
    background-clip: padding-box;
    border: 3px solid transparent;
    transition: var(--transition);
    /* Refined Cyber profile image border & shadow */
    box-shadow: 0 0 15px rgba(0, 176, 255, 0.4); /* Blue initial glow */
}
.profile-image-container::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: -1;
    margin: -5px;
    border-radius: inherit;
    background: linear-gradient(45deg, var(--cyber-primary-green), var(--cyber-secondary-blue));
    transition: var(--transition);
    animation: gradient-pan 20s linear infinite;
}
.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: var(--transition);
}
.profile-image-container:hover {
    transform: scale(1.03); /* Subtle scale */
    box-shadow: 0 0 25px rgba(0, 176, 255, 0.8); /* Stronger blue glow on hover */
}
.profile-image-container:hover::before { transform: rotate(180deg); }

/* --- SKILLS SECTION --- */
.skills-section { margin-top: 3rem; }
.skills-row, .tools-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem; /* Smaller gap */
    margin: 2rem 0;
}
.skill-icon, .tool-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--transition);
    position: relative;
    padding: 1rem 0.8rem; /* Adjusted padding */
    border-radius: var(--border-radius);
    background: var(--card-bg-dark);
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.1);
    border: 1px solid rgba(0, 230, 118, 0.2);
    min-width: 100px; /* Ensure consistent size */
    text-align: center;
}
.light-theme .skill-icon, .light-theme .tool-icon {
    background: var(--card-bg-light);
    box-shadow: 0 0 8px rgba(26, 115, 232, 0.1);
    border: 1px solid rgba(26, 115, 232, 0.2);
}
.skill-icon img, .tool-icon img {
    width: 60px; /* Slightly smaller icons */
    height: 60px;
    object-fit: contain;
    transition: var(--transition);
    filter: grayscale(70%) blur(0.5px); /* Less aggressive filter */
    opacity: 0.8;
}
.skill-icon:hover, .tool-icon:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.5); /* Stronger green glow */
    border-color: var(--cyber-primary-green);
    background: rgba(0, 230, 118, 0.08); /* Subtle green background */
}
.light-theme .skill-icon:hover, .light-theme .tool-icon:hover {
    box-shadow: 0 0 20px rgba(26, 115, 232, 0.4);
    border-color: var(--primary-light);
    background: rgba(26, 115, 232, 0.05);
}
.skill-icon:hover img, .tool-icon:hover img {
    transform: scale(1.1);
    filter: none;
    opacity: 1;
}
.skill-icon span, .tool-icon span {
    margin-top: 0.6rem; /* More space */
    font-size: 0.85rem;
    color: var(--text-muted-dark); /* Muted text normally */
    text-align: center;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}
.light-theme .skill-icon span, .light-theme .tool-icon span { color: var(--text-muted-light); }
.skill-icon:hover span, .tool-icon:hover span {
    color: var(--cyber-primary-green); /* Green on hover */
    font-weight: 500;
    text-shadow: 0 0 5px var(--cyber-primary-green);
}
.light-theme .skill-icon:hover span, .light-theme .tool-icon:hover span {
    color: var(--primary-light);
    text-shadow: 0 0 5px var(--primary-light);
}

/* --- PROJECTS SECTION --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Slightly smaller min-width */
    gap: 1.8rem; /* Reduced gap */
    margin-top: 2rem;
    align-items: stretch;
}
.project-container {
    background: var(--card-bg-dark);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--box-shadow-subtle);
    height: 100%;
    display: flex;
    flex-direction: column;
    /* Refined Cyber project card styling */
    border: 2px solid rgba(0, 176, 255, 0.3); /* Subtle blue border */
    box-shadow: 0 0 12px rgba(0, 176, 255, 0.2); /* Subtle blue shadow */
    background: linear-gradient(135deg, var(--card-bg-dark), rgba(0, 176, 255, 0.03)); /* Very subtle blue gradient */
}
.project-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px; /* Thinner top line */
    background: linear-gradient(90deg, var(--cyber-secondary-blue), var(--cyber-primary-green));
    transition: transform 0.3s ease-out; /* Slower transition for effect */
    transform: scaleX(0);
    transform-origin: left;
}
.project-container::after {
    content: "";
    position: absolute;
    left: var(--project-glow-x);
    top: var(--project-glow-y);
    width: 200px; /* Smaller glow */
    height: 200px;
    background: radial-gradient(circle, var(--cyber-accent-purple) 0%, transparent 70%);
    opacity: var(--project-glow-opacity);
    transform: translate(-50%, -50%);
    transition: opacity 0.4s ease, transform 0.1s linear; /* Fast transition for mouse follow */
    filter: blur(60px); /* More blur */
    z-index: 0;
}
.project-content, .project-container h3, .project-btn {
    position: relative;
    z-index: 1;
}
.light-theme .project-container {
    background: var(--card-bg-light);
    border-color: rgba(0, 0, 0, 0.08);
    border: 2px solid rgba(26, 115, 232, 0.2);
    box-shadow: 0 0 12px rgba(26, 115, 232, 0.1);
    background: linear-gradient(135deg, var(--card-bg-light), rgba(26, 115, 232, 0.02));
}
.project-container:hover {
    transform: translateY(-6px) scale(1.01); /* Gentle lift and scale */
    box-shadow: 0 0 20px rgba(0, 176, 255, 0.6); /* Stronger blue glow */
    border-color: var(--cyber-primary-green); /* Border turns green on hover */
}
.project-container:hover::before { transform: scaleX(1); }
.project-container h3 {
    margin-bottom: 0.8rem;
    color: var(--cyber-secondary-blue); /* Project titles in neon blue */
    text-shadow: 0 0 8px rgba(0, 176, 255, 0.4); /* Blue text glow */
}
.light-theme .project-container h3 {
    color: var(--primary-light);
    text-shadow: none;
}
.project-content { flex: 1; }
.project-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.4rem; /* More generous padding */
    background: transparent;
    color: var(--cyber-primary-green); /* Green text */
    border: 2px solid var(--cyber-primary-green);
    border-radius: 5px; /* Less rounded for a sharper look */
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    margin-top: 1.2rem; /* Reduced margin */
    align-self: flex-start;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.3);
}
.light-theme .project-btn {
    color: var(--primary-light);
    border-color: var(--primary-light);
}
.project-btn:hover {
    background: var(--cyber-primary-green);
    color: var(--darker-bg); /* Dark text on green background */
    transform: scale(1.03); /* Subtle scale */
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.8); /* Stronger green glow */
}
.light-theme .project-btn:hover { background: var(--primary-light); }

/* --- CONTACT SECTION --- */
#contact {
    background-image: url('images/cyber-monitor.jpg'); /* Ensure this path is correct */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}
#contact::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(1, 4, 9, 0.92), rgba(1, 4, 9, 0.85) 70%, rgba(1, 4, 9, 0.7)); /* More transparent at bottom */
    backdrop-filter: blur(6px);
    z-index: -1;
    /* Subtle scanline effect, less opaque */
    background-image: linear-gradient(to bottom, transparent 50%, rgba(0, 230, 118, 0.03) 50%);
    background-size: 100% 4px; /* Thinner lines */
    animation: scanlines 12s linear infinite; /* Slower animation */
}

.light-theme #contact::before {
    background: linear-gradient(rgba(248, 249, 250, 0.92), rgba(248, 249, 250, 0.85) 70%, rgba(248, 249, 250, 0.7));
    background-image: linear-gradient(to bottom, transparent 50%, rgba(26, 115, 232, 0.03) 50%);
}
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem; /* Reduced gap */
    max-width: 550px; /* Slightly narrower form */
    margin: 0 auto;
}
.form-group { position: relative; }
.form-group label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    background: var(--dark-bg); /* Background matching body for clean hover */
    padding: 0 0.5rem;
    color: var(--text-muted-dark);
    font-size: 1rem;
    transition: all 0.2s ease-out;
    pointer-events: none;
    z-index: 2;
    /* Cyber form label color */
    color: var(--cyber-primary-green); /* Green label */
    text-shadow: 0 0 3px rgba(0, 230, 118, 0.2);
}
.light-theme .form-group label {
    background: var(--light-bg);
    color: var(--text-muted-light);
}

.form-control:focus + label,
.form-control:not(:placeholder-shown) + label {
    top: 0;
    left: 0.8rem;
    font-size: 0.8rem;
    color: var(--cyber-secondary-blue); /* Blue on focus */
    transform: translateY(-50%);
    background: var(--dark-bg); /* Ensure background is body color on active */
    text-shadow: 0 0 5px rgba(0, 176, 255, 0.4);
}
.light-theme .form-control:focus + label,
.light-theme .form-control:not(:placeholder-shown) + label {
    color: var(--primary-light);
    background: var(--light-bg);
}
.form-control {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius);
    color: var(--text-dark);
    font-size: 1rem;
    transition: var(--transition);
    /* Refined Cyber form control styling */
    border: 2px solid rgba(0, 230, 118, 0.4); /* Green border */
    box-shadow: 0 0 5px rgba(0, 230, 118, 0.1);
    background-color: rgba(0, 230, 118, 0.02); /* Very subtle green background */
    color: var(--text-dark); /* Keep text-dark for clarity */
    font-family: 'Share Tech Mono', monospace;
}
.light-theme .form-control {
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: var(--text-light);
}
.form-control:focus {
    outline: none;
    border-color: var(--cyber-secondary-blue); /* Blue border on focus */
    box-shadow: 0 0 15px rgba(0, 176, 255, 0.5); /* Stronger blue glow */
    background-color: rgba(0, 176, 255, 0.05); /* Subtle blue background on focus */
}
.light-theme .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 15px rgba(26, 115, 232, 0.3);
}
textarea.form-control { min-height: 120px; resize: vertical; } /* Smaller textarea */

/* --- BUTTONS --- */
.btn-pulsate { animation: pulse 2.5s infinite; }
.submit-btn {
    padding: 0.9rem 1.8rem; /* Slightly smaller padding */
    background: linear-gradient(45deg, var(--cyber-primary-green), var(--cyber-secondary-blue));
    background-size: 200% auto;
    color: var(--darker-bg); /* Dark text for contrast */
    border: none;
    border-radius: 4px; /* Sharper corners */
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Share Tech Mono', monospace; /* Monospace font */
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0, 230, 118, 0.4);
    width: 100%;
    max-width: 220px; /* Slightly wider button */
    margin: 0 auto;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: none; /* No text shadow for clarity */
}
.light-theme .submit-btn {
    background: linear-gradient(45deg, var(--primary-light), var(--secondary-light));
    background-size: 200% auto;
}
.submit-btn:hover {
    transform: translateY(-3px); /* Gentle lift */
    box-shadow: 0 6px 18px rgba(0, 176, 255, 0.6); /* Blue glow on hover */
    background-position: right center;
    background: linear-gradient(45deg, var(--cyber-secondary-blue), var(--cyber-primary-green)); /* Gradient shift */
}
.btn { /* General button style */
    position: relative;
    display: inline-block;
    margin-top: 20px;
    padding: 12px 25px; /* Adjusted padding */
    background: linear-gradient(45deg, var(--cyber-secondary-blue), var(--cyber-accent-purple));
    color: white;
    border: none;
    border-radius: 4px; /* Sharper corners */
    font-weight: bold;
    cursor: pointer;
    transition: all 0.4s ease;
    overflow: hidden;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
    box-shadow: 0 5px 15px rgba(0, 176, 255, 0.3);
    z-index: 1;
    text-shadow: none;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 176, 255, 0.5);
    background: linear-gradient(45deg, var(--cyber-accent-purple), var(--cyber-primary-green)); /* Gradient shift */
}

/* --- FOOTER & SOCIALS --- */
.social-media {
    display: flex;
    justify-content: center;
    gap: 1.2rem; /* Reduced gap */
    margin-top: 2rem;
}
.social-media a {
    color: var(--text-muted-dark);
    font-size: 1.4rem; /* Slightly smaller icon */
    transition: var(--transition);
    width: 45px; /* Smaller size */
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    /* Refined Cyber social media icon styling */
    border: 2px solid rgba(0, 230, 118, 0.4); /* Subtle green border */
    color: var(--cyber-primary-green); /* Green icon */
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.2);
}
.light-theme .social-media a {
    color: var(--text-muted-light);
    border-color: rgba(0, 0, 0, 0.08);
}
.social-media a:hover {
    color: var(--cyber-secondary-blue); /* Blue on hover */
    border-color: var(--cyber-secondary-blue);
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 0 15px rgba(0, 176, 255, 0.6); /* Stronger blue glow */
    background: rgba(0, 176, 255, 0.08); /* Subtle blue background */
}
.light-theme .social-media a:hover {
    color: var(--primary-light);
    border-color: var(--primary-light);
    background: rgba(26, 115, 232, 0.05);
}
footer {
    text-align: center;
    padding: 1.8rem; /* Slightly less padding */
    background: var(--darker-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 1;
    /* Refined Cyber footer styling */
    border-top: 2px solid rgba(171, 71, 188, 0.3); /* Subtle purple border */
    box-shadow: 0 -2px 15px rgba(171, 71, 188, 0.15); /* Subtle purple shadow */
    color: var(--text-muted-dark); /* Muted text for copyright */
    font-size: 0.9rem;
}
.light-theme footer {
    background: var(--lighter-bg);
    border-top: 2px solid rgba(26, 115, 232, 0.1);
    box-shadow: 0 -2px 15px rgba(26, 115, 232, 0.1);
    color: var(--text-muted-light);
}

/* --- BACK TO TOP BUTTON --- */
.back-to-top {
    position: fixed;
    bottom: 1.8rem;
    right: 1.8rem;
    width: 48px;
    height: 48px;
    background: var(--cyber-secondary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0, 176, 255, 0.4);
    border: 2px solid rgba(0, 176, 255, 0.6);
}
.light-theme .back-to-top { background: var(--primary-light); }
.back-to-top:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 176, 255, 0.8);
    border-color: var(--cyber-primary-green);
    background: var(--cyber-primary-green);
}
.back-to-top.active { opacity: 1; visibility: visible; }

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .nav-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 1.5rem;
    }

    .nav-logo {
        margin-bottom: 1rem;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        display: none; /* Hidden by default for mobile toggle */
        background: var(--darker-bg); /* Match nav background */
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 1rem;
        border-radius: 0 0 var(--border-radius) var(--border-radius);
        box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.2);
    }
    .light-theme .nav-links {
        background: var(--lighter-bg);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
        animation: fadeInUp 0.4s ease forwards;
    }

    .nav-links li {
        margin: 0;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03); /* Subtle separator */
    }
    .light-theme .nav-links li {
        border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        padding: 0.8rem 0;
        width: 100%;
        border-radius: 0;
    }
    .nav-links a:hover {
        border-radius: 0; /* No rounding for full-width items */
    }
    .nav-links a::after {
        height: 1px; /* Thinner line for mobile */
        transform: scaleX(0.9); /* Fill more space for mobile */
    }

    .mobile-menu-toggle {
        display: block;
        position: absolute;
        right: 1.5rem;
        top: 4.2rem; /* Moved lower to avoid overlap with theme toggle */
        background: transparent;
        border: 2px solid var(--cyber-primary-green);
        color: var(--cyber-primary-green);
        padding: 0.5rem 0.8rem;
        font-size: 1.5rem;
        cursor: pointer;
        border-radius: var(--border-radius);
        transition: var(--transition);
        z-index: 1001; /* Above logo but below theme toggle */
        box-shadow: 0 0 10px rgba(0, 230, 118, 0.3);
    }
    .light-theme .mobile-menu-toggle {
        border-color: var(--primary-light);
        color: var(--primary-light);
        box-shadow: 0 0 10px rgba(26, 115, 232, 0.2);
    }
    .mobile-menu-toggle:hover {
        background: var(--cyber-primary-green);
        color: var(--darker-bg);
        box-shadow: 0 0 15px rgba(0, 230, 118, 0.6);
    }
    .light-theme .mobile-menu-toggle:hover {
        background: var(--primary-light);
        color: var(--lighter-bg);
    }

    .theme-toggle {
        top: 1rem;
        right: 1.5rem;
        z-index: 1002; /* Ensure theme toggle is above hamburger */
    }

    #home h1 {
        font-size: 2.8rem;
    }
    .typing-text {
        font-size: 1.4rem;
    }

    .section-content {
        padding: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr; /* Single column for projects on small screens */
    }
}

@media (max-width: 768px) {
    section {
        padding: 6rem 0;
    }
    #home h1 {
        font-size: 2.2rem;
    }
    .typing-text {
        font-size: 1.2rem;
    }
    .profile-image-container {
        width: 180px;
        height: 180px;
    }
    .skill-icon, .tool-icon {
        min-width: 80px;
        padding: 0.8rem 0.6rem;
    }
    .skill-icon img, .tool-icon img {
        width: 50px;
        height: 50px;
    }
    .skill-icon span, .tool-icon span {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    .nav-content {
        padding: 1rem 1rem;
    }
    .mobile-menu-toggle {
        right: 1rem;
        top: 4.2rem; /* Keep lower on small screens too */
    }
    .theme-toggle {
        top: 1rem;
        right: 1rem;
    }
    #home h1 {
        font-size: 1.8rem;
    }
    .typing-text {
        font-size: 1rem;
        height: 2rem;
    }
    .section-content {
        padding: 1.5rem;
    }
    .form-group label {
        font-size: 0.9rem;
    }
    .form-control:focus + label,
    .form-control:not(:placeholder-shown) + label {
        font-size: 0.7rem;
    }
    .submit-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.8rem;
    }
    .btn {
        padding: 10px 20px;
        font-size: 0.8rem;
    }
}
