/* Enhanced Styles for AIGC Portfolio - v3 (Portfolio Aspect Ratio Update) */
/* Main Font: Noto Sans SC (already linked in HTML) */

/*
Color Palette:
- Background: bg-slate-950 (#020617)
- Primary Text: text-slate-200 (#e2e8f0)
- Accent Cyan: text-cyan-400 (#22d3ee), border-cyan-500, bg-cyan-500
- Accent Purple: text-purple-400 (#c084fc), border-purple-500, bg-purple-600
- Accent Pink: text-pink-500 (#ec4899)
- Subtle UI: slate-700 (#334155), slate-800 (#1e293b), slate-900 (#0f172a)
- Glows/Shadows: Utilising cyan and purple for depth
*/

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #020617; /* Equivalent to Tailwind's slate-950 for a deeper base */
    color: #e2e8f0; /* slate-200 */
    overflow-x: hidden; /* Prevent horizontal scrollbars */
}

/* Page Transitions */
.page {
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.5s ease-in-out;
    will-change: transform, opacity;
    min-height: 100vh; /* Ensure pages take full viewport height */
}

.page:not(.active-page) {
    opacity: 0;
    pointer-events: none;
    position: absolute; /* Prevent layout shifts during transition */
    width: 100%;
}

/* Navigation Bar */
#main-nav {
    background-color: rgba(2, 6, 23, 0.6); /* slate-950 with transparency */
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(14, 165, 233, 0.1); /* Deeper shadow + cyan glow */
    height: 4.5rem; /* 72px */
}
@media (min-width: 768px) {
    #main-nav {
        height: 5.5rem; /* 88px */
    }
}

#main-nav.scrolled {
    background-color: rgba(2, 6, 23, 0.85); /* More opaque on scroll */
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4), 0 0 50px rgba(14, 165, 233, 0.15);
}

/* Nav Link Active State */
.nav-link.active-nav-item {
    background-color: rgba(14, 165, 233, 0.15); /* Subtle cyan background */
    color: #22d3ee; /* cyan-400 */
    border-radius: 0.375rem; /* rounded-md */
    box-shadow: inset 0 0 10px rgba(14, 165, 233, 0.2), 0 0 15px rgba(14, 165, 233, 0.1);
}
#desktop-nav-links .nav-link:not(.active-nav-item):hover,
#mobile-menu .nav-link:not(.active-nav-item):hover {
    background-color: rgba(30, 41, 59, 0.5); /* slate-800 with transparency */
}


/* Homepage Hero Section */
#home-page h1 {
    text-shadow: 0 0 15px rgba(14, 165, 233, 0.3), 0 0 30px rgba(168, 85, 247, 0.2);
}

/* Homepage Diamond/Preview Items */
.diamond-container {
    position: relative;
    width: 100%; /* Make it responsive within grid cell */
    aspect-ratio: 1 / 1; /* Maintain square shape */
    cursor: pointer;
    overflow: hidden;
    border-radius: 1rem; /* 16px, more rounded */
    background-color: #1e293b; /* slate-800 */
    box-shadow: 0 8px 15px rgba(0,0,0,0.2), 0 0 20px rgba(14, 165, 233, 0.1);
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.diamond-container:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 25px rgba(0,0,0,0.3), 0 0 30px rgba(14, 165, 233, 0.25), 0 0 40px rgba(168, 85, 247, 0.15);
}

.diamond-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); /* Hexagonal clip-path */
    transition: clip-path 0.4s ease-in-out, transform 0.4s ease-in-out;
    transform-origin: center center;
}

.diamond-container:hover .diamond-image {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); /* Square on hover */
    transform: scale(1.1);
}

.diamond-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.9) 25%, rgba(2, 6, 23, 0) 100%);
    color: white;
    padding: 1.5rem 1rem 1rem; /* More padding */
    text-align: center;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    pointer-events: none;
}
.diamond-overlay h3 {
    font-weight: 600;
    color: #67e8f9; /* cyan-300 */
}
.diamond-overlay p {
    font-size: 0.875rem;
    color: #94a3b8; /* slate-400 */
}

.diamond-container:hover .diamond-overlay {
    opacity: 1;
    transform: translateY(0);
}
.diamond-container-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #334155; /* slate-700 */
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b; /* slate-500 */
    font-size: 0.8rem;
    text-align: center;
}


/* Portfolio Page & Items */
#portfolio-page {
    background-color: #0f172a; /* slate-900 */
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem; /* 12px */
    background-color: #1e293b; /* slate-800 */
    box-shadow: 0 6px 12px rgba(0,0,0,0.25), 0 0 15px rgba(14, 165, 233, 0.05);
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

/* Container for the image thumbnail in the portfolio grid */
.portfolio-image-container {
    width: 100%;
    height: 280px; /* Fixed height for consistent grid item height. Adjust as needed. */
    /* Or use Tailwind: e.g., in HTML, add class="h-72" (288px) or similar */
    overflow: hidden;
    border-radius: 0.75rem 0.75rem 0 0; /* Rounded top if info panel is separate, or full if image is background */
    /* Match this with portfolio-item's border-radius if they are the same visual block */
    background-color: #111827; /* Dark background for letterboxing (slate-900 equivalent) */
    position: relative; /* For positioning zoom button */
    cursor: pointer; /* Indicates the area is clickable (to toggle info panel) */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.4s ease;
}

.portfolio-item.info-active .portfolio-image-container {
    transform: scale(0.95); /* Slightly shrink image container when info is active */
    filter: brightness(0.8); /* Dim the image slightly */
}

/* The actual image thumbnail */
img.portfolio-main-image {
    display: block;
    width: 100%;
    height: 100%; /* Fill the .portfolio-image-container height */
    object-fit: contain; /* THIS IS THE KEY CHANGE: Maintains aspect ratio, letterboxes if needed */
    /* REMOVED: aspect-ratio: 4/3; */
    /* REMOVED: min-height: 200px; */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: inherit; /* Inherit border-radius from parent if any specific rounding is desired on image itself */
}

.portfolio-item:not(.info-active):hover img.portfolio-main-image {
    transform: scale(1.05); /* Subtle zoom on image itself, not container, when info is not active */
}


/* Portfolio Info Panel (Slide-out) */
.portfolio-info-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 45%; /* Adjust height as needed, relative to .portfolio-item */
    background: linear-gradient(to top, rgba(15, 23, 42, 0.98) 70%, rgba(15, 23, 42, 0.8) 100%); /* slate-900 based gradient */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: white;
    padding: 1.25rem; /* p-5 */
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.3s ease-out, transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-top: 1px solid rgba(51, 65, 85, 0.7); /* slate-700 border */
    /* If .portfolio-item has rounded corners, this panel might need them too at the top */
    /* border-radius: 0 0 0.75rem 0.75rem; /* If it's at the very bottom of a rounded card */
    display: flex;
    flex-direction: column;
    justify-content: center;
    pointer-events: none; /* Initially not interactive */
    z-index: 1; /* Ensure it's above the image container if there's overlap without transform */
}

.portfolio-item.info-active .portfolio-info-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto; /* Interactive when visible */
}

.portfolio-info-panel .info-title {
    font-size: 1.75rem; /* text-2xl, increased */
    font-weight: 700; /* bold */
    color: #67e8f9; /* cyan-300 */
    margin-bottom: 0.5rem; /* mb-2 */
    text-decoration: underline;
    text-decoration-color: #a855f7; /* purple-500 */
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    transition: color 0.3s ease;
}
.portfolio-info-panel .info-title:hover {
    color: #c084fc; /* purple-400 */
}

.portfolio-info-panel .info-description {
    font-size: 0.95rem; /* Slightly larger */
    color: #cbd5e1; /* slate-300 */
    line-height: 1.6;
    max-height: 100px; /* Adjust based on panel height, approx 4-5 lines */
    overflow-y: auto; /* Scroll for longer descriptions */
}
/* Custom scrollbar for description */
.portfolio-info-panel .info-description::-webkit-scrollbar {
    width: 6px;
}
.portfolio-info-panel .info-description::-webkit-scrollbar-track {
    background: rgba(51, 65, 85, 0.5); /* slate-700 transparent */
    border-radius: 3px;
}
.portfolio-info-panel .info-description::-webkit-scrollbar-thumb {
    background: #67e8f9; /* cyan-300 */
    border-radius: 3px;
}

.portfolio-zoom-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(14, 165, 233, 0.6); /* cyan-500 transparent */
    color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8) translateZ(0); /* Added translateZ for better transform performance */
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    z-index: 5; /* Above image, below info panel if info panel overlaps */
    pointer-events: none; /* Initially not clickable */
}
.portfolio-item.info-active .portfolio-zoom-button {
    opacity: 1;
    transform: scale(1) translateZ(0);
    pointer-events: auto; /* Clickable when info is active */
}
.portfolio-zoom-button:hover {
    background-color: rgba(168, 85, 247, 0.8); /* purple-500 transparent */
    transform: scale(1.15) translateZ(0); /* Slightly larger hover effect */
}


/* Portfolio Navigation Arrows and Dots */
.portfolio-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(30, 41, 59, 0.7); /* slate-800 transparent */
    color: #94a3b8; /* slate-400 */
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.portfolio-nav-arrow:hover {
    background-color: #0ea5e9; /* cyan-600 */
    color: white;
    transform: translateY(-50%) scale(1.1);
}
.portfolio-nav-arrow.left-0 { left: -15px; }
.portfolio-nav-arrow.right-0 { right: -15px; }
@media (max-width: 767px) {
    .portfolio-nav-arrow.left-0 { left: 5px; }
    .portfolio-nav-arrow.right-0 { right: 5px; }
}

.portfolio-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #475569; /* slate-600 */
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 0 5px;
}
.portfolio-dot.active {
    background-color: #0ea5e9; /* cyan-500 */
    transform: scale(1.3);
}

/* Category Filters */
.filter-btn {
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem; /* rounded-lg */
    font-weight: 500; /* medium */
    background-color: #334155; /* slate-700 */
    color: #cbd5e1; /* slate-300 */
}
.filter-btn:hover {
    background-color: #475569; /* slate-600 */
    color: white;
    transform: translateY(-2px);
}
.filter-btn.active {
    background-color: #0ea5e9; /* cyan-500 */
    color: white;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.4), 0 0 25px rgba(14, 165, 233, 0.2);
    transform: translateY(-2px);
}

/* AI Assistant Page */
#ai-assistant-page {
    background-color: #0f172a; /* slate-900 */
}
#ai-assistant-page aside {
    background-color: rgba(2, 6, 23, 0.5); /* slate-950 transparent */
    border-right: 1px solid rgba(51, 65, 85, 0.5); /* slate-700 border */
}
.ai-nav-link {
    transition: background-color 0.3s ease, color 0.3s ease, padding-left 0.3s ease;
}
.ai-nav-link.active-ai-nav {
    background-color: rgba(14, 165, 233, 0.15); /* cyan-500 transparent */
    color: #67e8f9; /* cyan-300 */
    padding-left: 1.5rem; /* Indent active link */
    border-left: 3px solid #0ea5e9; /* cyan-500 */
}
.ai-content-panel {
    animation: fadeInPanel 0.5s ease-in-out forwards;
}
@keyframes fadeInPanel {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
.ai-file-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #cbd5e1; /* slate-300 */
    background-color: #1e293b; /* slate-800 */
    background-clip: padding-box;
    border: 1px solid #334155; /* slate-700 */
    appearance: none;
    border-radius: 0.5rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.ai-file-input::-webkit-file-upload-button {
    padding: 0.75rem 1rem;
    margin: -0.75rem -1rem;
    margin-inline-end: 1rem;
    color: white;
    background-color: #0ea5e9; /* cyan-500 */
    border: 0;
    border-radius: 0.5rem 0 0 0.5rem;
    transition: background-color 0.2s ease;
}
.ai-file-input::-webkit-file-upload-button:hover {
    background-color: #0891b2; /* cyan-600 */
}
.ai-file-input:focus {
    border-color: #0ea5e9; /* cyan-500 */
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(14, 165, 233, 0.3);
}
.ai-preview-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #1e293b; /* slate-800 */
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px dashed #334155; /* slate-700 */
}
.default-preview-icon {
    font-size: 3rem;
    color: #475569; /* slate-600 */
}
.ai-media-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.375rem; /* rounded-md */
}
.ai-media-preview:not([src="#"]):not([src=""]) { /* Show if src is set */
    display: block;
}
.ai-media-preview[src="#"], .ai-media-preview[src=""] { /* Hide if src is not set */
    display: none;
}
.ai-media-preview:not([src="#"]):not([src=""]) + .default-preview-icon { /* Hide icon if preview shown */
    display: none;
}

.ai-text-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #cbd5e1; /* slate-300 */
    background-color: #1e293b; /* slate-800 */
    border: 1px solid #334155; /* slate-700 */
    border-radius: 0.5rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.ai-text-input:focus {
    border-color: #0ea5e9; /* cyan-500 */
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(14, 165, 233, 0.3);
}
.ai-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem; /* py-2.5 px-5 */
    font-weight: 500; /* medium */
    color: white;
    background: linear-gradient(to right, #0ea5e9, #6366f1); /* cyan-500 to indigo-500 */
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06), 0 0 15px rgba(14, 165, 233, 0.2);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}
.ai-action-button:hover {
    background: linear-gradient(to right, #0891b2, #4f46e5); /* cyan-600 to indigo-600 */
    box-shadow: 0 6px 10px -1px rgba(0,0,0,0.15), 0 4px 6px -1px rgba(0,0,0,0.1), 0 0 20px rgba(14, 165, 233, 0.3);
    transform: translateY(-2px);
}
.ai-action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: translateY(0);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}
.ai-result-box {
    background-color: #1e293b; /* slate-800 */
    padding: 1.5rem;
    border-radius: 0.5rem;
    min-height: 150px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
.ai-result-text {
    color: #94a3b8; /* slate-400 */
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap; /* Preserve line breaks from API */
}
.ai-result-text.text-green-500 { color: #22c55e; } /* For success messages */
.ai-result-text.text-red-500 { color: #ef4444; } /* For error messages */


/* Image Modal */
#image-modal {
    background-color: rgba(2, 6, 23, 0.92); /* slate-950 with more opacity */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
#image-modal > div { /* The direct child, modal content container */
    background-color: #0f172a; /* slate-900 */
    border: 1px solid #334155; /* slate-700 */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 50px rgba(14, 165, 233, 0.2);
}
#close-modal {
    transition: color 0.3s ease, transform 0.3s ease;
}
#close-modal:hover {
    color: #0ea5e9; /* cyan-500 */
    transform: rotate(90deg) scale(1.1);
}

/* Modal content styling when description is overlaid */
.modal-info-container.overlay-mode {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 30%, rgba(15, 23, 42, 0) 100%);
    padding: 1.5rem;
    max-height: 40%; /* Adjust as needed */
    overflow-y: auto;
    border-radius: 0 0 0.75rem 0.75rem; /* rounded-xl for bottom */
}
.modal-info-container.overlay-mode #modal-title {
    color: #67e8f9; /* cyan-300 */
    text-shadow: 0 0 8px rgba(14, 165, 233, 0.5);
}
.modal-info-container.overlay-mode #modal-description {
    color: #e2e8f0; /* slate-200 */
}
#modal-image {
    transition: transform 0.3s ease;
    /* Ensure it respects its intrinsic aspect ratio within the modal's allocated space */
    object-fit: contain; 
    max-width: 100%;
    max-height: 100%; /* This will be constrained by its parent div in the modal flex layout */
}

/* Animations */
.animate-fade-in { animation: fadeInAnimation 0.7s ease-out forwards; opacity: 0;}
.animate-fade-in-down { animation: fadeInDownAnimation 0.7s ease-out forwards; opacity: 0; }
.animate-fade-in-up { animation: fadeInUpAnimation 0.7s ease-out forwards; opacity: 0; }
.animate-zoom-in { animation: zoomInAnimation 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }

@keyframes fadeInAnimation {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeInDownAnimation {
    from { opacity: 0; transform: translateY(-25px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUpAnimation {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes zoomInAnimation {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

/* Animation Delays (already defined in HTML via Tailwind, but can be centralized here if needed) */
.animation-delay-300 { animation-delay: 0.3s; }
.animation-delay-500 { animation-delay: 0.5s; } /* Added a new one */
.animation-delay-700 { animation-delay: 0.7s; } /* Added a new one */


/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #0f172a; /* slate-900 */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #334155; /* slate-700 */
    border-radius: 10px;
    border: 2px solid #0f172a; /* Creates a padding effect */
}
::-webkit-scrollbar-thumb:hover {
    background: #475569; /* slate-600 */
}


/* Responsive Adjustments */
@media (max-width: 1023px) { /* lg breakpoint */
    #hero-portfolio-items {
        grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 columns for medium screens */
    }
     .portfolio-image-container {
        height: 260px; /* Adjust height for tablets */
    }
}

@media (max-width: 767px) { /* md breakpoint */
    #main-nav { height: 4rem; /* 64px */ }
    #main-nav .container { padding-left: 1rem; padding-right: 1rem; }
    #home-page h1 { font-size: 3.5rem; /* Adjust as needed */ } /* text-6xl roughly */
    #home-page p { font-size: 1.125rem; } /* text-lg */

    #hero-portfolio-items {
        grid-template-columns: repeat(2, minmax(0, 1fr)); /* Still 2 columns for small screens */
        gap: 1rem; /* smaller gap */
    }
    .diamond-container, .diamond-container-placeholder {
        border-radius: 0.75rem; /* smaller radius */
    }

    #portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); /* More flexible for small screens */
        gap: 1rem;
    }
    .portfolio-item { border-radius: 0.5rem; }
    .portfolio-image-container {
        height: 220px; /* Adjust height for smaller mobile screens */
    }
    .portfolio-info-panel .info-title { font-size: 1.25rem; }
    .portfolio-info-panel .info-description { font-size: 0.875rem; }

    #ai-assistant-page .container { flex-direction: column; }
    #ai-assistant-page aside {
        max-height: none; /* Allow full scroll on mobile */
        margin-bottom: 1rem;
        border-right: none;
        border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    }
    #ai-assistant-page main { padding: 1rem; }
    .ai-nav-link.active-ai-nav { padding-left: 1rem; border-left-width: 2px; }

    #image-modal > div { /* Modal content container */
        max-height: 95vh;
        flex-direction: column;
    }
    #image-modal #modal-image { /* Image within the modal */
         max-height: 50vh; /* Smaller image in modal on mobile */
    }
    #image-modal .modal-info-container { /* Info container within the modal */
        max-height: 40vh;
        text-align: center;
    }
    #image-modal .modal-info-container.overlay-mode {
        position: relative; /* Back to normal flow in column layout for mobile */
        background: transparent; /* Remove gradient overlay on mobile if not desired */
        padding: 1rem;
    }
}

@media (max-width: 480px) { /* Even smaller screens */
    #home-page h1 { font-size: 2.5rem; }
    #home-page p { font-size: 1rem; }
    #hero-portfolio-items {
        grid-template-columns: repeat(1, minmax(0, 1fr)); /* 1 column for very small screens */
    }
    .portfolio-image-container {
        height: 200px; /* Adjust height for very small screens */
    }
    .portfolio-nav-arrow { padding: 0.5rem; }
    .portfolio-info-panel { height: 50%; } /* Allow more space for info */
    .portfolio-info-panel .info-title { font-size: 1.1rem; }

    .filter-btn { padding: 0.4rem 0.8rem; font-size: 0.875rem; }
    .ai-action-button { padding: 0.5rem 1rem; font-size: 0.875rem; }
}
