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

/* --- Global Variables & Styles --- */
:root {
    --font-heading: "Lobster Two", cursive;
    --font-body: "Poppins", sans-serif;
    --nav-bg: #14213d;
    --sec-bg: #000000;
    --sec-bg-darker: #111F35;
    --text-color: #FFFFFF;
    --bg-color: #14213d;
    --accent-color: #F63049;
    --accent-hover-color: #8A244B;
}

/* --- Light Theme Variables --- */
body.light-theme {
    --nav-bg: #F0F0F0;
    --sec-bg: #FFFFFF;
    --sec-bg-darker: #EAEAEA;
    --text-color: #14213d;
    --bg-color: #F9F9F9;
    /* Note: Some elements with hardcoded colors might need specific overrides. */
}

body {
        background-color: var(--bg-color);
        overflow-x: hidden;
}

/* --- Navigation Bar --- */
#navbar {
    display: flex;
    height: 80px;
    width: 100%;
    background-color: var(--nav-bg);
    justify-content: space-between;
    align-items: center;
    padding: 0 50px;
    position: relative; /* Needed for mobile menu positioning */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-bottom: 2px solid var(--accent-color);
}
#navbar h1 {
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 2.5rem;
    text-decoration: underline;
    margin-left: -40px;
    margin-bottom: 10px;

}
#navbar ul {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 30px;
}
#navbar ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.2rem;
    padding: 5px;
    border: 2px solid transparent;
    transition: 0.3s;

}
#navbar ul li a:link {
    color: var(--text-color);
}
#navbar ul li a:visited {
    color: var(--text-color);
}
#navbar ul li a:hover {
    background-color: var(--bg-color);
    border: 2px solid var(--bg-color);
    border-radius: 10px;
    text-decoration: none;
}
#navbar ul li a:active {
    background-color: var(--text-color);
    color: var(--accent-color);
    border: 2px solid var(--text-color);
}
#navbar ul li a.active {
    background-color: var(--bg-color);
    border: 2px solid var(--bg-color);
    border-radius: 10px;
    font-weight: 600;
}

/* Theme Toggle Buttons */
#theme-toggle-container button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}
/* --- Home Page Sections --- */
.main-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    max-width: 100%;
    margin: 0 auto;
    align-items: center;
    width: 100%;
}
#hero{
    display: flex;
    align-items: center;
    margin: 0;
    padding: 40px 20px;
    border-radius: 0;
    gap: 40px;
    width: 100%;
    max-width: none;
    height: auto;
    border-bottom: 2px solid var(--accent-color);
}
.hero-content {
    color: var(--text-color);
    flex: 1;
    text-align: left;
}
.hero-image {
    width: 150px;
    height: 150px;
    border: 3px solid var(--accent-color);
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background-color: var(--text-color);
}
.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-content h2 {
    font-family: var(--font-heading);
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: 3rem;
}
.hero-content p {
    line-height: 1.6;
    font-size: 1.2rem;
}

/* Carousel & Scroll Styles */
.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden; /* Hide the overflowing content for marquee effect */
    display: flex;
    align-items: center;
}
.scroll-content {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    padding: 10px 5px;
    width: 100%;
}
.scroll-content::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}
#skills {
    display: flex;
    flex-direction: column; /* Stack items vertically */
    align-items: center;    /* Center the heading and content */
    margin: 0;
    padding: 10px 20px 40px 20px;
    border-radius: 0;
    gap: 20px;
    width: 100%;
    max-width: none;
    height: auto;
    border-bottom: 2px solid var(--accent-color);
    text-align: center;
}
/* Keyframes for auto-scrolling animation */
@keyframes auto-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Moves content to the left */
}

#skills h2 {
    color: var(--text-color);
    margin-bottom: 0;
    font-family: var(--font-heading);
    font-size: 2rem;
    text-decoration: none;
}
#skills .scroll-content {
    list-style: none;
    align-items: stretch;
    width: max-content;
    overflow: visible;
    padding: 10px 0;
    /* Add animation */
    animation: auto-scroll 40s linear infinite;
}
#skills .scroll-content:hover {
    animation-play-state: paused;
}
#skills li {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background-color: #1A2C45;
    padding: 20px 15px;
    border-radius: 10px;
    width: 210px;
    gap: 15px;
    transition: 0.3s;
    border: 1px solid transparent;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
#skills li i {
    font-size: 4rem; /* Increased icon size */
}
/* Icon specific colors */
#skills .fa-html5 { color: rgb(255, 113, 0); }
#skills .fa-css3-alt { color: rgb(0, 208, 255); }
#skills .fa-js { color: rgb(255, 234, 1); }
#skills .fa-node-js { color: #68A063; /* Node.js Green */ }
#skills .fa-python { color: rgb(0, 81, 255); }
#skills .fa-palette { color: rgb(166, 255, 0); }
#skills .fa-cube { color: rgb(255, 0, 0); }
#skills .fa-video { color: rgb(212, 0, 255); }
#skills li span {
    color: var(--text-color);
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
    line-height: 1.5;
}
#skills li:hover {
    transform: translateY(-2px);
    border: 1px solid var(--accent-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* --- Home Page: Services Section --- */
#services {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 40px 20px; /* Added side padding for consistent margins */
    width: 100%;
    text-align: center;
}
#services h2 {
    color: var(--text-color);
    margin-bottom: 30px; /* Added more space */
    font-family: var(--font-heading);
    font-size: 2rem;
    text-decoration: none;
}

#services .scroll-content {
    gap: 30px; /* Spacing between service boxes */
    padding: 10px 0; /* Horizontal padding is now on the #services container */
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
}
.service-box {
    position: relative;
    width: 220px;
    height: 320px; /* Vertical cuboid shape */
    background-color: #1A2C45;
    border-radius: 10px;
    overflow: hidden; /* This is key */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.4s ease-in-out;
    border: 1px solid #2A3C55;
    flex-shrink: 0; /* Prevent boxes from shrinking in flex container */
}

.service-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 25px rgba(0,0,0,0.4);
    border-color: var(--accent-color);
}

.service-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: height 0.4s ease-in-out;
}

.service-box:hover .service-bg-image {
    height: 50%; /* On hover, image takes top half */
}

.service-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(26, 44, 69, 1) 50%, rgba(26, 44, 69, 0.8));
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    transform: translateY(100%); /* Initially hidden */
    transition: transform 0.4s ease-in-out;
}

.service-box:hover .service-overlay {
    transform: translateY(0); /* Revealed on hover */
}

.service-overlay h3 {
    font-family: var(--font-heading);
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.service-overlay p {
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.service-link {
    color: var(--text-color);
    font-size: 2.5rem; /* Larger arrow */
    transition: all 0.3s ease;
}

.service-link:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

#recent-work {
   display: flex;
   flex-direction: column;
   align-items: center;
   margin: 0;
   padding: 40px 20px;
    border-radius: 0;
    gap: 15px;
    width: 100%;
    max-width: none;
    height: auto;
    border-bottom: 2px solid var(--accent-color);
    text-align: center;
}
#recent-work h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-color);
}
.work-item {
    background-color: #1A2C45;
    border-radius: 6px;
    overflow: hidden;
    transition: 0.3s;
    border: 1px solid transparent;
}
.work-item:hover {
    cursor: pointer;
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.work-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.work-item h3 {
    color: var(--accent-color);
    font-family: var(--font-heading);
    padding: 15px 15px 5px;
}
.work-item p {
    color: #ccc;
    padding: 0 15px 20px;
    font-size: 0.9rem;
}

/* --- Portfolio Page Specifics --- */
.page-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--text-color);
    text-align: center;
    margin: 40px 0;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* --- Portfolio Modal --- */
.modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
}

.modal-overlay.show-modal {
    display: flex; /* Show with flex for centering */
}

.modal-content {
    background-color: var(--sec-bg-darker);
    margin: auto;
    padding: 30px;
    border: 1px solid var(--accent-color);
    width: 80%;
    max-width: 1100px;
    border-radius: 10px;
    position: relative;
    color: var(--text-color);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.close-modal {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--text-color);
}

.modal-body {
    display: flex;
    gap: 30px;
    overflow: hidden; /* To contain the scrolling right pane */
}

.modal-left {
    flex: 2; /* Takes up 2/3 of the space */
    display: flex;
    flex-direction: column;
}

#modal-main-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

#modal-title {
    font-family: var(--font-heading);
    color: var(--accent-color);
    font-size: 2rem;
    margin-bottom: 10px;
}

#modal-description {
    line-height: 1.6;
    font-size: 1rem;
}

.modal-right {
    flex: 1; /* Takes up 1/3 of the space */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Important for child scrolling */
}

.modal-right h4 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.gallery-scroll {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-right: 10px; /* For scrollbar space */
}

.gallery-scroll img {
    width: 100%;
    border-radius: 5px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-scroll img:hover {
    transform: scale(1.05);
}

#contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 40px 20px;
    border-radius: 0;
    gap: 15px;
    width: 100%;
    color: var(--text-color);
    text-align: center;
    border-bottom: 2px solid var(--accent-color);
}
#contact h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 5px;
}
#contact p {
    line-height: 1.6;
}
.contact-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--accent-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: 0.3s;
    margin-top: 10px;
}
.contact-button:hover {
    background-color: var(--accent-hover-color);
    transform: scale(1.05);
}

/* --- Social Media & Footer --- */
#social-media {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    margin: 0;
    padding: 0 50px 20px 50px;
    background-color: transparent;
    border-radius: 0;
    gap: 12px;
    width: 100%;
    max-width: 1200px;
    color: var(--text-color);
    margin: 0 auto 20px auto;
}
#social-media ul {
    list-style: none;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    align-items: center;
}
#social-media ul li {
    font-size: 1rem;
    background-color: var(--accent-color);
    padding: 10px 20px;
    border-radius: 50px;
    transition: 0.3s;
}
#social-media ul li:hover {
    background-color: var(--accent-hover-color);
    transform: scale(1.05);
}
#social-media ul li a {
    color: var(--text-color);
    text-decoration: none;
    transition: 0.3s;
}
#social-media ul li a:hover {
    color: var(--text-color);
    text-decoration: none;
}

/* Icon-only social button (e.g., Instagram) */
#social-media ul li.icon-only {
    background: none;
    padding: 0;
    border-radius: 0;
}
#social-media ul li .social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: var(--accent-color);
    border-radius: 50%;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
    transition: transform 0.2s, background-color 0.2s;
}
#social-media ul li .social-icon:hover {
    background-color: var(--accent-hover-color);
    transform: scale(1.05);
}

.closure {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--text-color);
    margin: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.closure::before,
.closure::after {
    content: '';
    flex: 1;
    height: 2px;
    background-color: var(--accent-color);
    margin: 0 20px;
}

#footer {
    width: 100%;
    padding: 50px 0;
    background-color: var(--sec-bg-darker);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 50px;
    text-align: left;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 30px auto;
    padding: 0 50px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-column {
    flex: 1;
    min-width: 250px;
}
.footer-column h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}
.footer-column ul {
    list-style: none;
}
.footer-column p, .footer-column ul li a {
    color: #ccc;
    line-height: 1.6;
    text-decoration: none;
    transition: 0.3s;
    display: block;
    margin-bottom: 10px;
}
.footer-column ul li a:hover {
    color: var(--text-color);
    padding-left: 5px;
}
.footer-bottom {
    border: none;
    padding: 20px 50px;
    text-align: center;
    font-size: 0.9rem;
    color: #888;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* --- Responsive Design --- */

/* Hamburger Menu Styles (initially hidden on desktop) */
#menu-toggle {
    display: none;
}
.hamburger-menu {
    display: none; /* Hidden by default */
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}
.hamburger-menu .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 5px;
    transition: all 0.3s ease-in-out;
}

/* Tablet and Mobile Styles */
@media (max-width: 768px) {
    /* Navbar */
    #navbar {
        padding: 0 20px;
    }
    #navbar h1 { margin-left: 0; }
    #navbar ul {
        position: absolute;
        top: 80px; /* Height of the navbar */
        left: 0;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--nav-bg);
        flex-direction: column;
        justify-content: center;
        gap: 40px;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 100;
    }
    .hamburger-menu {
        display: flex; /* Show the hamburger icon */
    }
    #menu-toggle:checked ~ ul {
        transform: translateX(0); /* Slide menu in */
    }
    #menu-toggle:checked ~ .hamburger-menu .bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    #menu-toggle:checked ~ .hamburger-menu .bar:nth-child(2) {
        opacity: 0;
    }
    #menu-toggle:checked ~ .hamburger-menu .bar:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* Layout */
    .main-container { padding: 10px; }
    #hero { flex-direction: column; text-align: center; }
    .footer-container { flex-direction: column; text-align: center; }
    .footer-column ul { padding: 0; }

}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    #navbar h1 { font-size: 2rem; margin-left: 0; }
    .hero-image { width: 120px; height: 120px; }
    .hero-content h2, #skills h2, #services h2, #recent-work h2, #contact h2, #social-media h2 { font-size: 1.8rem; }
    .footer-column h3 { font-size: 1.5rem; }
    #skills li, .service-card {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    .closure {
        font-size: 1.5rem;
        margin: 30px 10px;
    }
    .closure::before,
    .closure::after {
        margin: 0 10px;
    }
}