/* Reset and Base Styles */
/* Default: Dark Theme Variables */
:root {
    --primary-color: #004526; /* Dark Green */
    --secondary-color: #006A4E; /* Complementary Green for hover/accents */
    --text-color: #EAEAEA; /* Light grey for main text */
    --light-text: #A0A0A0; /* Dimmer grey for secondary text */
    --background: #121212; /* Very dark grey/off-black background */
    --section-bg: #1E1E1E; /* Slightly lighter dark grey for sections */
    --card-bg: #252525; /* Background for cards */
    --border-color: #333333; /* Subtle border color */
    --modal-bg: rgba(0, 0, 0, 0.7);
    --header-bg: rgba(30, 30, 30, 0.7);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --button-text-color: #FFFFFF;
    --transition: all 0.3s ease;
}

/* Light Theme Variables */
body[data-theme='light'] {
    --primary-color: #006A4E; /* Slightly brighter green for light mode */
    --secondary-color: #004526; /* Darker green for hover */
    --text-color: #1f2937;    /* Dark text */
    --light-text: #6b7280;    /* Grey text */
    --background: #ffffff;    /* White background */
    --section-bg: #f3f4f6;    /* Light grey section background */
    --card-bg: #ffffff;       /* White card background */
    --border-color: #e5e7eb;    /* Light border color */
    --modal-bg: rgba(0, 0, 0, 0.4); /* Lighter modal overlay */
    --header-bg: rgba(255, 255, 255, 0.7);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --button-text-color: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Smooth transition for color changes */
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background); 
    position: relative; /* Needed for overlay positioning */
    overflow-x: hidden; /* Prevent horizontal scroll */
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4rem;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-color);
    border-bottom: 1px solid var(--border-color);
}

.header .container {
    display: flex;
    align-items: center;
    height: 60px;
    position: relative;
    padding: 0;
    padding-right: 0; /* Remove right padding */
}

/* Push Nav to the right */
.nav {
    margin-left: auto;
    margin-right: 80px;
    padding-right: 1rem; /* Small padding to prevent edge touching */
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-left: 1rem;
    position: relative;
}

.logo-img {
    height: 30px;
    width: auto;
    transition: opacity 0.3s ease;
}

.light-logo {
    opacity: 1;
    position: relative;
    z-index: 1;
}

.dark-logo {
    opacity: 0;
    position: absolute;
    left: 1rem;
    z-index: 1;
}

/* Dark theme logo adjustments */
body[data-theme='dark'] .light-logo {
    opacity: 0;
}

body[data-theme='dark'] .dark-logo {
    opacity: 1;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--text-color) 0%, #a8e6cf 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.nav-list {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

.nav-list a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.95rem;
}

.nav-list a:hover {
    color: var(--primary-color);
}

/* Aesthetic Theme Slider Styles */
.theme-switch-wrapper {
    position: absolute;
    top: 50%;
    right: 1rem; /* Align with right edge */
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

/* Hide default HTML checkbox */
.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider track */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: background-color 0.4s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.slider.round {
    border-radius: 26px;
}

/* The slider knob */
.slider.round:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 2px;
    background-color: var(--light-text);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55), background-color 0.4s;
    border-radius: 50%;
    z-index: 1;
}

/* Slider knob color change based on theme */
input:checked + .slider:before {
    background-color: var(--primary-color);
}

/* Move slider knob to the right when checked */
input:checked + .slider:before {
    transform: translateX(24px);
}

/* Icon Styling */
.slider .icon-sun,
.slider .icon-moon {
    font-size: 12px;
    line-height: 1;
    z-index: 0;
    transition: opacity 0.4s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide moon icon in light mode (checkbox not checked) */
.slider .icon-moon {
    opacity: 0;
}

/* Hide sun icon in dark mode (checkbox checked) */
/*input:checked + .slider .icon-sun {
    opacity: 0;
}

/* Show moon icon in dark mode (checkbox checked) */
/*input:checked + .slider .icon-moon {
    opacity: 1;
}

/* Show sun icon in light mode (checkbox not checked) */
input:not(:checked) + .slider .icon-sun {
    opacity: 1;
}

/* Background Video Styles */
#background-video {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -1;
    background-color: var(--background);
}

/* Overlay for text readability */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
    pointer-events: none;
    transition: background-color 0.3s ease;
}

/* Adjust overlay for light mode */
body[data-theme='light']::before {
    background-color: rgba(255, 255, 255, 0.2); /* Lighter overlay for light theme */
}

/* Ensure content is above the video/overlay */
.header,
.hero,
.projects,
.footer,
.modal {
    position: relative;
    z-index: 1;
}

/* Hero Section Adjustment */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    /* Remove specific hero background - video will show through */
    /* background: linear-gradient(...), url(...) */ 
    color: #ffffff; 
    padding: 6rem 0;
    /* Add a subtle text shadow for extra readability */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

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

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: var(--button-text-color);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: var(--transition);
}

.cta-button:hover {
    background: var(--secondary-color);
    color: var(--button-text-color);
    transform: translateY(-2px);
}

/* Projects Section */
.projects {
    padding: 6rem 0;
    background: var(--section-bg);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--text-color) 0%, #a8e6cf 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.projects-slider {
    padding: 2rem 1rem;
}

.swiper-slide {
    height: auto;
}

/* Project Card Styles */
.project-card {
    background: linear-gradient(145deg, var(--card-bg), rgba(37, 37, 37, 0.95));
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 69, 38, 0.3);
    border-color: rgba(0, 69, 38, 0.3);
    background: linear-gradient(145deg, var(--card-bg), rgba(0, 69, 38, 0.1));
}

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

.project-content h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--text-color) 0%, #a8e6cf 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
}

.project-content p {
    color: var(--light-text);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 1rem;
    opacity: 0.9;
    flex-grow: 1;
}

.project-link.learn-more-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    width: fit-content;
    white-space: nowrap;
}

.project-link.learn-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 69, 38, 0.4);
    background: linear-gradient(145deg, var(--secondary-color), var(--primary-color));
}

/* Light Theme Adjustments */
body[data-theme='light'] .project-card {
    background: linear-gradient(145deg, var(--card-bg), rgba(255, 255, 255, 0.95));
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body[data-theme='light'] .project-card:hover {
    box-shadow: 0 8px 25px rgba(0, 106, 78, 0.2);
    border-color: rgba(0, 106, 78, 0.2);
    background: linear-gradient(145deg, var(--card-bg), rgba(0, 106, 78, 0.05));
}

body[data-theme='light'] .project-link.learn-more-btn {
    background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
}

body[data-theme='light'] .project-link.learn-more-btn:hover {
    box-shadow: 0 4px 15px rgba(0, 106, 78, 0.3);
    background: linear-gradient(145deg, var(--secondary-color), var(--primary-color));
}

/* Light theme text adjustments */
body[data-theme='light'] .project-content h3 {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body[data-theme='light'] .project-content p {
    color: var(--text-color);
    opacity: 0.85;
}

/* Swiper Custom Styles */
.swiper-button-next,
.swiper-button-prev {
    color: var(--text-color); /* Light grey arrows */
    background: var(--card-bg);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    box-shadow: 0 2px 6px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: var(--primary-color); /* Dark green background on hover */
    color: var(--button-text-color); /* White arrows on hover */
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 1.2rem;
}

.swiper-pagination-bullet {
    background: var(--light-text);
    opacity: 0.6;
}

.swiper-pagination-bullet-active {
    background: var(--text-color); /* Use light grey for active bullet */
    opacity: 1;
}

/* Footer Styles */
.footer {
    background: var(--background); /* Match main background */
    color: var(--text-color);
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-info h4 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: var(--text-color); /* Light grey footer heading */
}

.footer-info p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    color: var(--text-color);
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
}

.social-link:hover {
    opacity: 1;
    color: var(--secondary-color); /* Use secondary green for social hover */
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--light-text); /* Dimmer text for copyright */
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .nav-list {
        display: none;
    }

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

    .swiper-button-next,
    .swiper-button-prev {
        display: none;
    }
    
    .projects-slider {
        padding: 1rem 0;
    }
}

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

.hero-content, .project-card {
    animation: fadeIn 1s ease-out forwards;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1001; /* Above header */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--modal-bg);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--card-bg);
    margin: auto;
    padding: 30px;
    border-radius: 1rem;
    box-shadow: 0 8px 25px var(--shadow-color);
    position: relative;
    max-width: 400px;
    width: 85%;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.4s ease-out;
    border: 1px solid var(--border-color);
}

.modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* Add animation keyframes for zoom effect */
@keyframes modalZoomIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.modal.show .modal-content {
    animation: modalZoomIn 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.close-btn {
    color: var(--light-text);
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--text-color);
    text-decoration: none;
}

.modal-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-color); /* Light grey title in modal */
}

.modal-content p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-color); /* Light text in modal */
}

/* Light theme section title adjustment */
body[data-theme='light'] .section-title {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Light theme logo text adjustment */
body[data-theme='light'] .logo-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Favicon Styles */
link[rel="icon"] {
    border-radius: 50%;
    -webkit-mask-image: -webkit-radial-gradient(circle, white 100%, black 100%);
    mask-image: radial-gradient(circle, white 100%, black 100%);
}

/* Add a pseudo-element to create the rounded effect */
link[rel="icon"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: inherit;
    -webkit-mask-image: -webkit-radial-gradient(circle, white 100%, black 100%);
    mask-image: radial-gradient(circle, white 100%, black 100%);
}

.theme-icon {
    width: 12px;
    height: 12px;
    object-fit: contain;
    transition: opacity 0.4s;
}