/*
Theme Name: Ingrid Portfolio
Theme URI: https://example.com/ingrid-portfolio
Author: Custom Theme Creator
Author URI: https://example.com
Description: A custom WordPress theme for Ingrid's portfolio with smooth scrolling and a fixed sidebar.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ingrid-portfolio
*/

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

/* Variables */
:root {
    --bg-color: #f6e9f7;
    --primary-color: #3c3f72 !important;
    --secondary-color: #f7c8e0;
    --accent-color: #ffe5b4;
    --sidebar-bg: #faf9fb;
    --sidebar-text: #5a4e7c;
    --sidebar-active: #a18aff;
    --text-color: #4d4a51 !important;
    --muted-text: #8d7fa5 !important;
    --button-bg: #fff;
    --button-text: #a18aff;
    --button-border: #a18aff;
    --tag-bg: #e6d6f7;
    --tag-text: #5a4e7c;
    --input-bg: #fff;
    --input-border: #e6d6f7;
    --light-purple: #887cac; /* Light purple accent */
    --light-blue: #a8d8f0; /* Light blue accent */
    --font-main: 'Inter', sans-serif;
    --transition-speed: 0.3s;
    --sidebar-width: 280px; /* Adjusted sidebar width */
    --desktop-bg-image: url('images/desktop-background.png'); /* Use relative path as variable is defined in header */
    --mobile-bg-image: url('images/mobile-background.png'); /* Use relative path as variable is defined in header */
}

/* Timeline bar */
.timeline-bar {
    position: fixed;
    left: 30px;
    top: 0;
    height: 100%;
    width: 2px;
    background: linear-gradient(to bottom, var(--secondary-color), var(--light-purple));
    z-index: 99;
}

/* Global Styles */
body {
    font-family: var(--font-main);
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: white;
    text-decoration: none;
    transition: all var(--transition-speed) ease;
}

a:hover {
    color: var(--secondary-color);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0px;
    border-radius: 24px;
    box-shadow: 0 2px 24px 0 rgba(161,138,255,0.05);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
}

h2 {
    font-size: 2rem;
    color: var(--primary-color);
}

h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Layout */
.site {
    display: flex;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: var(--bg-color);
}

.site-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    background: linear-gradient(90deg, hsla(332, 53%, 82%, 1) 0%, hsla(176, 57%, 89%, 1) 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 50px 15px;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    z-index: 1;
    overflow-y: auto;
    color: var(--text-color);
}

/* Add rule to prevent interaction with main content when menu is open on mobile */
body.menu-open .site-main {
    pointer-events: none; /* Prevent clicks on the main content */
}

/* Only add background image overlay to the home page (hero section) */
.index-page .site-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--desktop-bg-image); /* Use CSS variable for desktop background */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.7; /* Transparent overlay */
    z-index: 0;
}

/* Use mobile background image on home page hero on smaller screens */
.index-page .site-main::before {
    background-image: var(--mobile-bg-image); /* Use CSS variable for mobile background */
}

/* Section base styles */
.section {
    position: relative;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
    z-index: 1;
}

/* Full viewport height sections (no scroll) */
.page-about .section,
.page-skills .section,
.page-contact .section,
.home .section {
    min-height: 100vh;
    padding: 80px 20px;
}

/* Scrollable sections */
.page-web-projects .section,
.page-graphic-design .section {
    min-height: 100vh;
    padding: 80px 10px;
    overflow-y: auto;
}

/* Container adjustments for full-height sections */
.page-about .container,
.page-skills .container,
.page-contact .container,
.home .container {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Page loader for transitions */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--secondary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInSidebar {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

@keyframes pulseButton {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Project Modal Styles */
/* Removed old modal container styles */

/* Removed old design modal styles */

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

.modal-url {
    display: inline-block;
    padding: 5px 25px;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    transition: all var(--transition-speed) ease;
    text-decoration: none;
    margin-top: 20px;
    margin-bottom: 20px;
    cursor: pointer;
}

.modal-url:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    z-index: 100;
    padding: 40px 0 0 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    color: var(--sidebar-text);
}

.sidebar-logo {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px 0;
}

.sidebar-logo img {
    max-width: 60px;
}

.sidebar-logo svg {
    width: 60px;
    height: 75px;
}

.sidebar-nav {
    flex: 1;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 30px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    position: relative;
    font-size: 16px;
    color: var(--sidebar-text);
    transition: all 0.3s ease;
    text-decoration: none;
}

.sidebar-nav a:hover {
    color: var(--sidebar-active);
    background: #ede3ff;
}

.sidebar-nav a.active {
    color: var(--sidebar-active);
    background: #ede3ff;
}

.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    height: 100%;
    width: 3px;
    background-color: var(--sidebar-active);
}

.sidebar-nav i {
    margin-right: 15px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* CV buttons */

/* Kept for potential use elsewhere */
.cv-buttons {
    padding: 0 30px;
    margin: 10px 0 30px 0;
}

.cv-button {
    display: block;
    background-color: var(--button-bg);
    color: var(--button-text);
    padding: 12px 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-speed) ease;
    border: 1px solid var(--button-border);
}

/* Visit buttons for hero section */
.visit-buttons {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    padding: 0;
    margin: 30px 0 0 0;
    justify-content: flex-start;
}

.visit-button {
    display: inline-flex; /* Allows side-by-side display */
    align-items: center;
    background-color: #5245aa; /* Brighter purple for buttons - same as old hero button */
    color: white;
    padding: 15px 30px;
    border-radius: 30px; /* Rounded corners */
    font-weight: 600;
    font-size: 16px;
    transition: all var(--transition-speed) ease;
    border: none; /* Remove border if present */
    text-decoration: none; /* Remove underline */
    cursor: pointer;
}

.visit-button:hover {
    background-color: var(--secondary-color); /* Hover color */
    color: var(--primary-color); /* Hover text color */
    transform: translateY(-2px); /* Slight lift effect */
    box-shadow: 0 5px 15px rgba(249, 147, 195, 0.4); /* Subtle shadow on hover */
}

/* Add responsive adjustments if necessary */
@media (max-width: 768px) {
    .visit-buttons {
        flex-direction: column; /* Stack buttons vertically on smaller screens */
        gap: 15px;
        margin-top: 20px;
        justify-content: center;
        align-items: center;
    }
    .visit-button {
        width: 100%; /* Make buttons full width on smaller screens */
        max-width: 250px;
        justify-content: center;
    }

    /* Hide the second button (Contact) on mobile */
    .visit-buttons .visit-button:last-child {
        display: none;
    }

    .site-main::before {
        background-image: var(--mobile-bg-image);
    }
}

@media screen and (max-width: 480px) {
    .visit-button {
        padding: 12px 25px;
        font-size: 0.9rem;
    }

    .site-main {
        padding: 40px 20px;
        background-image: var(--mobile-bg-image); /* Use CSS variable for mobile background */
        /* Removed general text color change here */
    }

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

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.5rem;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-menu-close {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 400;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.5rem;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Removed duplicate selector */

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 120px;
    padding-left: 80px;
    position: relative;
    text-align: left;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    position: relative;
    z-index: 2;
    opacity: 1;
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    position: relative;
    z-index: 2;
    opacity: 1;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.hero-button {
    display: inline-flex;
    align-items: center;
    background-color: #5245aa; /* Brighter purple for buttons */
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 16px;
    margin-top: 20px;
    transition: all var(--transition-speed) ease;
    opacity: 0;
    transform: translateY(30px);
}

.hero-button i {
    margin-left: 10px;
    font-size: 14px;
}

.hero-button:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(249, 147, 195, 0.4);
}

/* Projects Section */
.projects {
    padding: 80px 0;
    position: relative;
    overflow: visible;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    padding: 2.5rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.project-cover {
    width: 100%;
    height: 220px; /* Adjusted height for better fit */
    object-fit: cover; /* Changed to cover to fill space */
    overflow: hidden; /* Ensure content outside is hidden */
    border: none; /* Removed border based on provided image */
}

.project-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-info {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.project-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tools .tool {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.view-project-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.view-project-btn:hover {
    background: var(--primary-color-dark);
}

/* About Section */
.about {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; /* Center content horizontally */
}

.about-content {
    flex-direction: column;
    gap: 30px;
}

.about-image {
    width: 100%; /* Make image take full width of its container */
    max-width: 400px; /* Limit maximum image width */
    margin-bottom: 0; /* Remove extra margin if stacked */
    border-radius: 10px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    text-align: center; /* Center the image if it's smaller than container */
}

.about-image img {
    width: 100%;
    height: auto;
    display: block; /* Remove extra space below the image */
}

.about-text-bilingual {
    display: flex; /* Use flexbox for side-by-side layout on desktop */
    flex-direction: row; /* Arrange items in a row on desktop */
    gap: 40px; /* Add space between English and Japanese text */
    /* flex-direction: column; - This is for mobile, handled by media query */
    /* gap: 20px; - This is for mobile, handled by media query */
}

.about-text-en,
.about-text-jp {
    flex: 1; /* Allow text blocks to grow and shrink */
    min-width: 280px; /* Minimum width before wrapping */
    margin-bottom: 0; /* Remove bottom margin if within bilingual container */
}

.about-text-en p,
.about-text-jp p,
.section.about p {
    text-align: justify;
    line-height: 1.8; /* Added line height for better readability */
}

.about-deco {
    font-weight: bold;
    color: var(--primary-color) !important;
}

/* Skills Section */
.skills {
    padding: 80px 0;
}

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

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin-top: 40px;
}

.skill-category {
    background: var(--primary-color);
    padding: 30px;
    padding-bottom: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    overflow: visible;
}

.skill-category:hover {
    transform: translateY(-5px);
}

.category-header {
    text-align: center;
    margin-bottom: 25px;
}

.category-header i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.category-header h3 {
    color: white !important;
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.category-subtitle {
    color: white !important;
    opacity: 0.8;
    font-size: 0.9rem;
    margin: 0;
}

.skill-tags {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    align-items: center; /* Center items horizontally */
}

.skill-tag {
    background: var(--tag-bg);
    color: var(--text-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    width: fit-content;
    text-align: center; /* Center text within tags */
}

.skill-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: var(--button-bg);
}

@media screen and (max-width: 991px) {
    .site-main {
        margin-left: 0;
        width: 100%;
        padding: 60px 20px; /* Slightly increased vertical padding */
        background: linear-gradient(90deg, hsla(332, 53%, 82%, 1) 0%, hsla(176, 57%, 89%, 1) 100%); /* Ensure gradient background is applied */
    }

    /* Ensure the gradient background is visible on the home page hero for responsive by removing the image overlay */
    .index-page .site-main::before {
        background-image: none; /* Removed background image */
    }

    .hero {
        padding-top: 80px;
        padding-left: 20px;
        padding-bottom: 60px; /* Added bottom padding */
    }

    .hero h1 {
        font-size: 2.8rem; /* Slightly larger font size */
    }

    .hero h2 {
        font-size: 1.8rem; /* Slightly larger font size */
    }

    .hero p {
        font-size: 1.1rem;
        margin-bottom: 2rem; /* Adjusted bottom margin */
    }

    .projects-grid,
    .skills-grid,
    .design-grid { /* Ensure design-grid is included */
        grid-template-columns: 1fr;
        gap: 40px; /* Increased gap between items */
        padding: 0; /* Remove padding if container has it */
    }

    .contact-container {
        flex-direction: column;
        gap: 40px; /* Increased gap between contact info and form */
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 200; /* Ensure sidebar is above main content */
        pointer-events: auto; /* Ensure elements inside sidebar are clickable */
    }

    .sidebar.active {
        transform: translateX(0);
         z-index: 200; /* Keep z-index high when active */
    }

    /* Add an overlay when the menu is open */
    body.menu-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black overlay */
        z-index: 150; /* Between main content and sidebar */
        pointer-events: auto; /* Allow clicks on the overlay */
    }

    /* Prevent scrolling on the body when menu is open */
     body.menu-open {
        overflow: hidden;
    }
}

@media screen and (max-width: 767px) {
    .section {
        padding: 40px 15px; /* Adjusted padding for smaller screens */
    }

    .about-content,
    .contact-container {
        flex-direction: column;
    }

    .projects-grid,
    .skills-grid,
    .design-grid { /* Ensure design-grid is included */
        grid-template-columns: 1fr;
        gap: 30px; /* Adjusted gap */
        padding: 0; /* Remove padding if container has it */
    }

    .skill-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .skill-name {
        width: 100%;
        margin-bottom: 5px;
    }

    .skill-progress {
        width: 100%;
        margin: 0;
    }

    .skill-percentage {
        position: absolute;
        right: 0;
        top: -18px;
    }

    .hero h1 {
        font-size: 2.2rem; /* Adjusted font size */
    }

    .hero h2 {
        font-size: 1.5rem; /* Adjusted font size */
    }

    .shape {
        transform: scale(0.6);
    }

    .site-main {
        padding: 40px 20px;
        /* background-image: none; */ /* Removed background image to use default gradient */
        /* Removed general text color change here */
    }

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

    .visit-buttons {
        flex-direction: column;
        gap: 15px;
        margin-top: 20px;
        justify-content: center;
        align-items: center;
    }

    .visit-button {
        width: 100%; /* Make buttons full width on smaller screens */
        max-width: 250px;
        justify-content: center;
    }

    /* Hide the second button (Contact) on mobile */
    .visit-buttons .visit-button:last-child {
        display: none;
    }

    /* Adjust text color for better contrast on mobile background */
    .about-text-en,
    .about-text-jp {
        color: var(--text-color); /* Use the default text color for better contrast */
    }

    /* Ensure heading colors are readable */
    .site-main h1,
    .site-main h2,
    .site-main h3,
    .site-main h4,
    .site-main h5,
    .site-main h6 {
        color: var(--text-color);
    }

    .about-text-bilingual { /* Ensure stacking on mobile */
        flex-direction: column;
        gap: 20px;
    }
}

@media screen and (max-width: 480px) {
    .section {
        padding: 30px 10px; /* Adjusted padding for smaller screens */
    }

    .site-main {
        padding: 30px 10px;
        /* background-image: none; */ /* Removed background image to use default gradient */
    }
    
    .sidebar {
        width: 100%;
    }
    
    .mobile-menu-toggle {
        top: 15px;
        right: 15px;
    }
    
    .project-item, 
    .design-item {
        flex-direction: column;
    }
    
    .project-image, 
    .design-image {
        width: 100%;
        height: 200px;
    }
    
    .project-info, 
    .design-info {
        width: 100%;
        padding: 1rem; /* Adjusted padding */
    }

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

    .hero h2 {
        font-size: 1.2rem; /* Adjusted font size */
    }

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

    .projects-grid,
    .skills-grid,
    .design-grid {
        gap: 1.5rem; /* Adjusted gap */
        padding: 0; /* Remove padding if container has it */
    }

    .visit-button {
        padding: 12px 25px;
        font-size: 0.9rem;
    }
}

/* Update scrollbar for pastel look */
::-webkit-scrollbar {
    width: 10px;
    background: #f3e6f9;
}
::-webkit-scrollbar-thumb {
    background: var(--secondary-color); /* Changed scrollbar thumb color to secondary-color (pink) */
    border-radius: 8px;
}

/* Gradient background for main sections */
.about,
.projects,
.design,
.skills,
.contact {
    background: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(247, 200, 224, 0.9);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 95vh; /* Increased max-height to allow more vertical space for images */
    margin: auto;
    background: var(--primary-color);
    border-radius: 12px;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: row;
    gap: 2rem;
    color: #eee;
}

.modal-text-content {
    flex-basis: 30%; /* Adjusted to give more space to text content */
    min-width: 300px;
    color: #eee;
}

.modal-gallery {
    flex-basis: 70%; /* Adjusted to leave more space for text content */
    display: flex;
    flex-direction: column;
    gap: 20px; /* Added gap to ensure space between images */
    margin-top: 0;
    overflow-y: auto;
    padding-right: 10px;
    position: relative; /* Added for stacking context */
    z-index: 1; /* Added for stacking context */
}

.modal-main-image {
    width: 100%;
    height: auto !important; /* Changed to auto to display full image height */
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0; /* Remove margin-bottom as gap handles spacing */
    position: relative; /* Added for stacking context */
    z-index: 2; /* Ensure main image is on top */
}

.modal-main-image img {
    width: 100% !important;
    height: auto !important; /* Ensure height adjusts naturally based on width */
    object-fit: contain !important; /* Changed to contain to display full image height */
}

.modal-gallery-item {
    width: 100%;
    height: auto !important; /* Allow height to adjust naturally based on contained image */
    border-radius: 8px;
    /* Removed overflow: hidden; to prevent cutting of full height images */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0; /* Remove margin-bottom as gap handles spacing */
    position: relative; /* Added for stacking context */
    z-index: 1; /* Ensure gallery items are below main image */
}

.modal-gallery-item img {
    width: 100% !important;
    height: auto !important; /* Ensure height adjusts naturally based on width */
    object-fit: contain !important; /* Changed back to contain to display full image height */
}

/* REMOVED: Old thumbnail styles */
.modal-thumbnails {
    display: none;
}

.modal-thumbnail-item {
    display: none;
}

.modal-thumbnail-item:hover {
    display: none;
}

.modal-thumbnail-item img {
    display: none;
}

/* Removing old .gallery-item and related styles */
.gallery-item {
    display: none; /* Hide if still present */
}

.gallery-item.expanded {
    display: none; /* Hide if still present */
}

.gallery-item img {
    display: none; /* Hide if still present */
}

/* Modal Scrollbar */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color-dark);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .modal-content {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .modal-text-content,
    .modal-gallery {
        flex-basis: auto;
        min-width: auto;
        width: 100%;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-gallery {
        margin-top: 0;
    }

    .modal-main-image {
        height: auto !important; /* Adjusted for tablet */
    }

    .modal-gallery-item {
        height: auto !important; /* Adjusted for tablet */
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 1rem;
    }
    .modal-main-image {
        height: auto !important; /* Adjusted for mobile */
    }
    .modal-gallery-item {
        height: auto !important; /* Adjusted for mobile */
    }
}

.contact-container {
    display: flex;
    gap: 50px;
    margin-top: 50px;
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-form-container {
    flex: 1;
    min-width: 300px;
}

@media screen and (max-width: 991px) {
    .site-main {
        margin-left: 0;
        width: 100%;
        padding: 40px 20px;
    }

    .hero {
        padding-top: 80px;
        padding-left: 20px;
    }

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

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

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

    .projects-grid,
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }

    .contact-container {
        flex-direction: column;
        gap: 30px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 200; /* Ensure sidebar is above main content */
        pointer-events: auto; /* Ensure elements inside sidebar are clickable */
    }

    .sidebar.active {
        transform: translateX(0);
         z-index: 200; /* Keep z-index high when active */
    }

    /* Add an overlay when the menu is open */
    body.menu-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black overlay */
        z-index: 150; /* Between main content and sidebar */
        pointer-events: auto; /* Allow clicks on the overlay */
    }

    /* Prevent scrolling on the body when menu is open */
     body.menu-open {
        overflow: hidden;
    }
}

@media screen and (max-width: 480px) {
    .site-main {
        padding: 30px 15px;
    }

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

    .hero h2 {
        font-size: 1.2rem;
    }

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

    .projects-grid,
    .skills-grid {
        gap: 1.5rem;
        padding: 1rem;
    }
}

/* Footer Styles */
.site-footer {
    background-color: var(--primary-color); /* Set background to primary color */
    color: #fff; /* Set text color to white for contrast */
    padding: 30px 80px; /* Add some padding */
    text-align: center; /* Center the text */
    margin-left: var(--sidebar-width); /* Match the sidebar width */
    width: calc(100% - var(--sidebar-width)); /* Adjust width to fit next to sidebar */
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Responsive adjustments for footer */
@media screen and (max-width: 991px) {
    .site-footer {
        margin-left: 0; /* Remove margin on smaller screens */
        width: 100%; /* Full width on smaller screens */
        padding: 20px; /* Adjust padding for smaller screens */
    }
}

/* Add basic link styling for footer */
.site-footer a {
    color: #fff; /* White color for links */
    text-decoration: underline;
}

.site-footer a:hover {
    color: var(--secondary-color); /* Hover color */
}

.site-footer p {
    margin-bottom: 0; /* Remove default paragraph margin */
    font-size: 0.9rem;
}

/* Design Grid Layout */
.design-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    padding: 2.5rem;
}

.design-item {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.design-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.design-image {
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
}

.design-info {
    padding: 1.5rem;
}

.design-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.design-description {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    opacity: 0.8;
}

.design-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.design-tag {
    background: var(--tag-bg);
    color: var(--text-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Skills Tools Layout */
.skill-tags {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    align-items: center; /* Center items horizontally */
}

.skill-tag {
    background: var(--tag-bg);
    color: var(--text-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    width: fit-content;
    text-align: center; /* Center text within tags */
}

/* Media Queries */
@media screen and (max-width: 991px) {
    .design-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }
}

@media screen and (max-width: 480px) {
    .design-grid {
        gap: 1.5rem;
        padding: 1rem;
    }
    
    .design-image {
        height: 200px;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
    z-index: 1001;
}

.modal-close:hover {
    background: var(--accent-color);
    transform: rotate(90deg);
}

.modal-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.modal-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 40px;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
    text-align: center;
    padding: 0 15px;
    line-height: 1.2;
}

.modal-tag:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

.modal-descriptions {
    margin-bottom: 0;
}

.description-jp,
.description-en {
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.description-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.description-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.description-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.description-toggle {
    color: #fff;
    transition: transform var(--transition-speed) ease;
}

.description-toggle.expanded {
    transform: rotate(180deg);
}

.description-content {
    padding: 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed) ease;
}

.description-content.expanded {
    max-height: 500px;
}

.description-content p {
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.modal-title {
    font-size: 2.25rem !important;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white !important; /* Ensuring title color is white */
}

.contact-method i,
.contact-item i {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-right: 15px;
}

.social-links a i,
.contact-social .social-link i {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.social-links a:hover i,
.contact-social .social-link:hover i {
    color: var(--secondary-color);
}

/*CONTACT FORM START*/
/* Style the labels */
.wpcf7-form label {
  color: var(--primary-color);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Style input fields and textarea */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea {
  background-color: var(--bg-color);
  border: 2px solid var(--primary-color);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--primary-color);
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

/* Focus state for inputs */
.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form textarea:focus {
  border-color: var(--secondary-color);
  outline: none;
  background-color: #fff;
}

/* Style the submit button */
.wpcf7-form input[type="submit"] {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  border: none;
  padding: 12px 24px;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 30px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Hover effect on submit button */
.wpcf7-form input[type="submit"]:hover {
  background-color: var(--primary-color);
  color: var(--bg-color);
}
