/* Global Variables */
:root {
    --bg-dark: #f0f4f8;
    /* Light gray-blue background */
    --bg-gradient: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    --primary-color: #2563eb;
    /* Blue */
    --accent-color: #d97706;
    /* Dark Amber */
    --text-primary: #1e293b;
    /* Slate 800 */
    --text-secondary: #475569;
    /* Slate 600 */
    --glass-bg: rgba(255, 255, 255, 0.65);
    /* More opaque white for light mode */
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    --nav-height: 70px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Dark Mode System Preference Overrides */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        --text-primary: #f8fafc;
        /* Slate 50 */
        --text-secondary: #cbd5e1;
        /* Slate 300 */
        --glass-bg: rgba(15, 23, 42, 0.6);
        /* Dark glass */
        --glass-border: rgba(255, 255, 255, 0.1);
        --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
        --accent-color: #fbbf24;
        /* Amber 400 - brighter for dark mode */
        /* Primary color remains the same or slightly brighter if needed */
        --primary-color: #3b82f6;
        /* Blue 500 - slightly lighter than default */
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-gradient);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 16px;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.75rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Dark mode hover fix for glass-card */
@media (prefers-color-scheme: dark) {
    .glass-card:hover {
        background: rgba(30, 41, 59, 0.9);
        border-color: rgba(255, 255, 255, 0.15);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    }
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    background: linear-gradient(90deg, #60a5fa, #f472b6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Responsive Grid Utilities */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.grid-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }

    .section-header {
        margin-bottom: 40px;
    }

    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.35rem;
    }

    .grid-2-col,
    .grid-sidebar {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .glass-panel {
        padding: 25px !important;
        /* Override inline padding if necessary */
    }

    /* Center sidebar content on mobile if stacked */
    .grid-sidebar>div:last-child {
        text-align: center;
        margin: 0 auto;
    }
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding-top: 120px;
    background: url('../images/cover-photo.png') no-repeat center top;
    background-size: cover;
    background-attachment: fixed;
    /* Parallax effect */
    overflow: hidden;
}

/* Overlay for better text contrast */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(37, 99, 235, 0.3) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    /* Ensure content is above overlay */
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--glass-bg);
    /* Light background for navbar */
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    background: none;
    border: none;
}

/* Mobile Nav */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background: var(--glass-bg);
        backdrop-filter: blur(15px);
        flex-direction: column;
        align-items: center;
        padding: 40px 0;
        transform: translateY(-150%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-bottom: 1px solid var(--glass-border);
    }

    .nav-menu.active {
        transform: translateY(0);
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-link {
        display: block;
        padding: 15px 0;
        font-size: 1.1rem;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5);
}

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

.btn-secondary:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

/* Footer */
footer {
    background: var(--glass-bg);
    padding: 40px 0;
    text-align: center;
    margin-top: 60px;
    border-top: 1px solid var(--glass-border);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.copyright {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Generic Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
}

/* Project Card Styles */
.project-card {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    padding: 25px;
    align-items: start;
    overflow: hidden;
}

.carousel-container {
    width: 100%;
    max-width: 350px;
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.05);
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.02);
}

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

.project-content h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.project-content p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.project-tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--primary-color);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}

/* Responsive Project Cards */
@media (max-width: 900px) {
    .project-card {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .carousel-container {
        max-width: 100%;
        height: 220px;
    }
}

/* Custom 3-column layout for AI Twin project */
.project-card.split-view {
    grid-template-columns: 1fr 1.2fr 1fr;
    align-items: center;
}

.project-card.split-view .carousel-container {
    max-width: 100%;
    height: auto;
}

/* On mobile, stack them: Image 1, Image 2, Content */
@media (max-width: 900px) {
    .project-card.split-view {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Reorder to keep images together on mobile if desired, 
       currently: Img1(1), Content(2), Img2(3) -> Img1, Content, Img2 
       If we want Img1, Img2, Content: */
    .project-card.split-view .project-content {
        order: 3;
    }

    /* We assume the HTML structure will be Img1, Content, Img2 */
}

/*Form Styles*/
/* Enhanced Contact Form Styles - Smaller Version */
.contact-form {
    width: 100%;
    max-width: 450px;
    /* Reduced from 600px */
    margin: 0 auto;
}

.form-group {
    margin-bottom: 18px;
    /* Reduced from 24px */
}

.form-group label {
    display: block;
    font-size: 14px;
    /* Reduced from 16px */
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    /* Reduced from 14px 16px */
    font-size: 14px;
    /* Reduced from 16px */
    background-color: #1a2332;
    border: 2px solid #2d3748;
    border-radius: 6px;
    color: #ffffff;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4299e1;
    background-color: #243447;
}

.form-group textarea {
    min-height: 120px;
    /* Reduced from 150px */
    resize: vertical;
    font-family: inherit;
}

.submit-btn {
    width: 100%;
    padding: 12px 24px;
    /* Reduced from 16px 32px */
    font-size: 16px;
    /* Reduced from 18px */
    font-weight: 600;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Footer Fix - Centered */
footer {
    text-align: center;
    padding: 20px;
    background-color: #0f1419;
    color: #ffffff;
    width: 100%;
}

footer p {
    margin: 0;
    font-size: 14px;
}