:root {
    /* Centralized color configuration for modifiers */
    /* Vivid colors for selected states */
    --color-haircut: #ff6b6b;          /* Vivid red */
    --color-outfit: #4ecdc4;           /* Vivid teal */
    --color-accessory: #f7b731;        /* Vivid yellow/gold */
    --color-filter: #b794f6;           /* Vivid purple */

    /* Light colors for cached/pills */
    --color-haircut-light: #ffe0e0;    /* Light red */
    --color-outfit-light: #d4f1f0;     /* Light teal */
    --color-accessory-light: #fef5e7;  /* Light yellow */
    --color-filter-light: #f3e8ff;     /* Light purple */

    /* Other theme colors */
    --text-dark: #2d2d2d;
    --pastel-purple: #b794f6;
    --pastel-blue: #93c5fd;
    --pastel-pink: #fbb6ce;
    --pastel-yellow: #fde68a;
    --pastel-green: #a7f3d0;
    --pastel-purple-light: #e9d5ff;
}

body {
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #e3d5ff 0%, #ffd4e5 100%);  /* Lighter pastel gradient */
    min-height: 100vh;
    padding: 20px;
    color: #333;
    /* Removed animation */
}


.container {
    max-width: 1800px;
    margin: 0 auto;
}


/* Simple Layout */
.main-interface {
    position: fixed;
    top: 60px; /* Below navbar */
    left: 0;
    width: 100vw;
    height: calc(100vh - 60px); /* Full height minus navbar */
    background: #f5f5f5;
    z-index: 100;
    overflow: hidden;
    display: flex;
}

/* Top Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    border-bottom: 3px solid var(--text-dark);
    box-shadow: 0 3px 0 rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    padding: 0 30px;
    z-index: 10000;
}

.navbar-brand {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-dark);
    text-decoration: none;
    letter-spacing: -1px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand:hover {
    transform: translateY(-2px);
    text-shadow: 2px 2px 0 rgba(183, 148, 246, 0.5);
}

.navbar-brand:active {
    transform: translateY(0);
}

.navbar-subtitle {
    margin-left: auto;
    font-size: 14px;
    color: #999;
    font-style: italic;
}


.app-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%; /* Full height of parent */
    gap: 0;
    overflow: hidden;
}

.app-container.is-base-loading,
.app-container[data-base-loading="true"] {
    pointer-events: none;
    user-select: none;
    cursor: progress;
}

.app-container.is-base-loading .result-area,
.app-container[data-base-loading="true"] .result-area {
    pointer-events: none;
}

body.is-waiting-image {
    cursor: progress;
}

body.is-waiting-image * {
    cursor: progress !important;
}

/* Sidebars - Simple */
.base-image-picker, .modifiers-picker {
    background: rgba(255,255,255,0.95);
    height: 100%;
    position: relative;
    /* Removed transition for snappy resizing */
    flex-shrink: 0;
    overflow: visible;  /* Allow delete buttons to overflow */
    display: flex;
    flex-direction: column;
}

.base-image-picker {
    width: 320px;
    border-right: 3px solid var(--text-dark);
}

.base-image-picker.collapsed {
    width: 40px;
}

.modifiers-picker {
    width: 600px;
    border-left: 3px solid var(--text-dark);
    position: relative;
}

.modifiers-picker.collapsed {
    width: 40px;
}

/* Center content with minimum width */
.center-content {
    flex: 1;
    min-width: 600px; /* Reduced minimum width for center content */
    background: rgba(255,255,255,0.95);
    height: 100%;
    overflow-y: auto;
    position: relative;
    padding: 20px; /* Minimal padding */
    display: flex;
    flex-direction: column;
}

/* Draggable vertical resizer between content and right sidebar */
.resizer-right {
    flex: 0 0 6px;
    cursor: col-resize;
    background: transparent;
    position: relative;
    z-index: 20;
}
.resizer-right::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 2px;
    width: 2px;
    background: rgba(45,45,45,0.2);
}
.resizer-right:hover::before {
    background: rgba(45,45,45,0.4);
}

.sidebar-toggle {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-dark);
    box-shadow: none;
    opacity: 1;
    transition: transform 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    transform: scale(1.3);
    background: transparent;
    box-shadow: none;
}

.base-image-picker .sidebar-header {
    justify-content: flex-start;
}

.modifiers-picker .header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sidebar-header .header-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

/* Sidebar header section */
.sidebar-header {
    padding: 15px 20px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    flex-shrink: 0;
    transition: border-bottom 0.2s ease;
}

/* Show border when scrolled */
.sidebar-header.scrolled {
    border-bottom: 2px solid var(--text-dark);
}

/* Sidebar footer section - same as header */
.sidebar-footer {
    padding: 15px 20px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    flex-shrink: 0;
    border-top: 2px solid transparent;
    transition: border-top 0.2s ease;
}

/* Extra padding for left sidebar footer */
.base-image-picker .sidebar-footer {
    padding: 15px 20px 30px 20px;
    height: 75px;
}

/* Magnet floating animation */
@keyframes magnet-float {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.05) rotate(-1deg); }
}

@keyframes magnet-float-hover {
    0% { transform: scale(1.08) rotate(-2deg); }
    100% { transform: scale(1.12) rotate(2deg); }
}


.result-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
}

.generate-controls {
    width: 100%;
    display: flex;
    justify-content: center;
    min-height: 56px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.generate-controls.is-disabled #generateBtn {
    animation: none;
    opacity: 0.6;
}

.generate-controls.is-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.generate-controls.is-disabled #generateBtn::after {
    display: none;
}

#generateBtn {
    background: #00ff88;
    color: var(--text-dark);
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 700;
    border: 2px solid var(--text-dark);
    border-radius: 8px;
    box-shadow: 3px 3px 0 var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 150px;
    position: relative;
    overflow: hidden;
    animation: magnet-float 0.8s ease-in-out alternate infinite;
}

#generateBtn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transform: skewX(-20deg);
    transition: all 0.5s;
}

#generateBtn .generate-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#generateBtn:hover:not(.generating):not(:disabled)::after {
    left: 130%;
}

#generateBtn:hover:not(.generating):not(:disabled) {
    animation: magnet-float-hover 0.4s ease-in-out alternate infinite;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5), 3px 3px 0 var(--text-dark);
    background: #00ffaa;
}

#generateBtn:active:not(.generating):not(:disabled) {
    transform: scale(0.98);
    box-shadow: 1px 1px 0 var(--text-dark);
}

#generateBtn:disabled {
    cursor: not-allowed;
    box-shadow: 3px 3px 0 var(--text-dark);
}

#generateBtn.generating {
    animation: none;
    background: #ff6b6b;
    color: white;
}

#generateBtn.generating::after {
    display: none;
}

#generateBtn .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
    margin: 0;
    line-height: 0;
}

#generateBtn.generating .spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#generateBtn.generating .generate-icon {
    display: none;
}

/* Show border when content is scrollable */
.sidebar-footer.scrollable {
    border-top: 2px solid var(--text-dark);
}

.sidebar-footnote {
    display: block;
    margin: 0 20px;
    padding: 12px 0 16px;
    font-size: 13px;
    line-height: 1.4;
    color: rgba(45, 45, 45, 0.75);
    text-align: center;
}

.sidebar-header .sidebar-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.sidebar-header .random-btn,
.sidebar-header .reset-btn {
    padding: 8px 16px;
    border: 2px solid var(--text-dark);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 3px 3px 0px var(--text-dark);
    transition: all 0.2s ease;
}

.sidebar-header .random-btn {
    background: var(--pastel-yellow);
}

.sidebar-header .reset-btn {
    background: var(--pastel-pink);
}

/* Add spacing between icon and text in buttons */
.sidebar-header .random-btn i,
.sidebar-header .reset-btn i {
    margin-right: 6px;
}

/* Make dice icon a bit bigger */
.sidebar-header .random-btn i.nf-fa-dice {
    font-size: 1.1em;
}

.sidebar-header .random-btn:hover,
.sidebar-header .reset-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px var(--text-dark);
}

.sidebar-header .random-btn:active,
.sidebar-header .reset-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0px var(--text-dark);
}

.sidebar-content {
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;   /* allow scrolling through sidebar content */
    overflow-x: hidden; /* avoid horizontal scroll */
    height: calc(100vh - 180px); /* adjust for header + footer height (60px each) */
}

/* Add extra bottom padding for right sidebar when footer is visible */
.modifiers-picker .sidebar-content {
    padding-bottom: 80px; /* Space for the Generate button footer */
}

.collapsed .sidebar-content,
.collapsed .sidebar-footer {
    opacity: 0;
    pointer-events: none;
}

/* Hide header content except toggle when collapsed */
.collapsed .sidebar-header .sidebar-title,
.collapsed .sidebar-header .random-btn,
.collapsed .sidebar-header .header-actions .random-btn {
    opacity: 0;
    pointer-events: none;
}

/* Keep chevron visible and positioned when collapsed */
.collapsed .sidebar-header .sidebar-toggle {
    opacity: 1;
    pointer-events: auto;
    position: absolute;
    top: 14px;
}

.base-image-picker.collapsed .sidebar-header .sidebar-toggle {
    left: 5px;
}

.modifiers-picker.collapsed .sidebar-header .sidebar-toggle {
    right: 5px;
}

.sidebar-content h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-align: center;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section .section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.sidebar-section .section-title i {
    font-size: 1.2rem;
}

.sidebar-images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.sidebar-divider {
    margin: 18px 0 8px;
    padding-top: 12px;
    border-top: 2px dashed rgba(45, 45, 45, 0.25);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(45, 45, 45, 0.6);
}

.sidebar-divider .divider-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.user-uploads-grid {
    margin-top: 12px;
}

.user-uploads-grid .uploaded-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.user-uploads-grid .uploaded-card .uploaded-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.2s ease;
}

.user-uploads-grid .uploaded-card .uploaded-modified-indicator {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 233, 134, 0.95);
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(45, 45, 45, 0.25);
    z-index: 9;
    pointer-events: none;
}

.user-uploads-grid .uploaded-card.modified .uploaded-thumb {
    box-shadow: 0 0 0 2px rgba(255, 233, 134, 0.9);
}

.user-uploads-grid .uploaded-thumb:hover,
.user-uploads-grid .uploaded-thumb:active {
    transform: none !important;
}

.user-uploads-grid .uploaded-thumb.selected,
.user-uploads-grid .uploaded-thumb.selected:hover {
    transform: none !important;
}

.user-uploads-grid .uploaded-card:hover {
    transform: translate(-2px, -2px);
}

.user-uploads-grid .uploaded-card:active {
    transform: translate(1px, 1px);
}

.user-uploads-grid .uploaded-card.selected {
    transform: translate(-4px, -4px);
}

.user-uploads-grid .uploaded-card.selected:hover {
    transform: translate(-4px, -4px);
}

.upload-remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
}

.uploaded-card:hover .upload-remove-btn,
.upload-remove-btn:focus-visible {
    opacity: 1;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.1);
    box-shadow: 2px 2px 0 rgba(45, 45, 45, 0.3);
}

.upload-remove-btn:hover {
    background: var(--pastel-pink);
    transform: scale(1.18);
}

.upload-remove-btn:active {
    transform: scale(1.05);
}

.upload-remove-btn:focus-visible {
    outline: 2px solid var(--text-dark);
    outline-offset: 2px;
}

.sidebar-images-grid img,
.sidebar-images-grid .upload-photo-btn {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid var(--text-dark);
    box-shadow: 3px 3px 0 var(--text-dark);
    transition: all 0.2s ease;
    position: relative;
}

/* Gray overlay for non-selected images */
.sidebar-images-grid img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Remove overlay when selected */
.sidebar-images-grid img.selected::after {
    opacity: 0;
}

/* Add overlay to non-selected images */
.sidebar-images-grid img:not(.selected) {
    filter: brightness(0.7) contrast(0.9);
}

/* Remove filter when selected */
.sidebar-images-grid img.selected {
    filter: none;
}

.sidebar-images-grid .upload-photo-btn {
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-style: dashed;
    box-shadow: none;
    padding: 12px;
    text-align: center;
    overflow: hidden;
}

.sidebar-images-grid .upload-photo-btn:focus-visible {
    outline: 2px solid var(--text-dark);
    outline-offset: 3px;
}

.sidebar-images-grid img:hover {
    transform: translate(-2px, -2px);
    /* Keep shadow in same position - don't move it */
    box-shadow: 3px 3px 0 var(--text-dark);
    /* Keep border same color on hover */
    border-color: var(--text-dark);
}

.sidebar-images-grid .upload-photo-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: none;
    border-color: var(--text-dark);
}

.sidebar-images-grid img:active {
    transform: translate(1px, 1px);
    box-shadow: 3px 3px 0 var(--text-dark);
}

.sidebar-images-grid .upload-photo-btn:active {
    transform: translate(1px, 1px);
    box-shadow: none;
}

.upload-photo-icon {
    font-size: 28px;
    color: var(--text-dark);
}

.upload-photo-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
}

body.editor-drop-active .sidebar-images-grid .upload-photo-btn,
.sidebar-images-grid.drag-hover {
    border-color: var(--pastel-blue);
}

.sidebar-images-grid.drag-hover {
    outline: 2px dashed rgba(104, 116, 232, 0.55);
    outline-offset: 6px;
}

.result-area::before,
.result-area::after {
    content: '';
    position: absolute;
    inset: -12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 5;
}

.result-area::before {
    border: 2px dashed rgba(104, 116, 232, 0.65);
    border-radius: 24px;
    background: rgba(183, 148, 246, 0.12);
}

.result-area::after {
    content: 'Drop image to upload';
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: rgba(45, 45, 45, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
}

body.editor-drop-active .result-area::before,
body.editor-drop-active .result-area::after,
.result-area.drag-hover::before,
.result-area.drag-hover::after {
    opacity: 1;
}

.result-area.is-image-loading::before,
.result-area.is-image-loading::after {
    opacity: 1;
    inset: 0;
    border-radius: 24px;
    z-index: 12;
}

.result-area.is-image-loading::before {
    border: none;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(70%) blur(1.5px);
}

.result-area.is-image-loading::after {
    content: '';
    width: 56px;
    height: 56px;
    border: 5px solid rgba(102, 126, 234, 0.28);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    z-index: 13;
    pointer-events: none;
    box-shadow: 0 6px 14px rgba(102, 126, 234, 0.25);
}

/* Selected state - move image more to top-left */
.sidebar-images-grid img.selected {
    transform: translate(-4px, -4px);
    /* Keep shadow in original position */
    box-shadow: 3px 3px 0 var(--text-dark);
    border-color: var(--text-dark);
}

.sidebar-images-grid .sidebar-empty {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 12px;
    color: rgba(45, 45, 45, 0.6);
    padding: 14px 8px;
    border: 2px dashed rgba(45, 45, 45, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
}

/* When selected AND hovering */
.sidebar-images-grid img.selected:hover {
    transform: translate(-4px, -4px);
    box-shadow: 3px 3px 0 var(--text-dark);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
}

/* Center Content - Simple */
.center-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-width: 0;
    overflow: hidden; /* prevent internal scrollbars */
    position: relative;
    height: 100%;     /* fill available vertical space */
}

.panel-header {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.panel-header h2 {
    font-size: 1.8rem;
    color: #333;
    margin: 0;
    text-transform: uppercase;
    font-weight: 700;
}

.panel-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    margin-top: 5px;
}


.result-area {
    /* Float directly on background: no panel/border/shadow */
    width: auto;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 0;
    position: relative;
    overflow: visible;
    box-shadow: none;
}

/* removed fixed calc sizing; image sizing handled below with viewport-based max sizes */

.placeholder {
    text-align: center;
    color: #999;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.placeholder p {
    font-size: 1rem;
    margin: 0;
}

.upload-section {
    margin-bottom: 25px;
}

.section-title {
    font-size: 1.6rem;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.file-upload input[type=file] {
    display: none;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    text-align: center;
}

.file-upload-label:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.file-preview {
    margin-top: 20px;
    border-radius: 15px;
    overflow: visible;
}

.file-preview img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.result-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    overflow: visible;
    width: 100%;
}

.images-comparison {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.image-title {
    font-size: 1.2rem;
    color: #333;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Result buttons (legacy compatibility) */
.result-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 20px;
}

/* Keep photo appropriately sized to the viewport without scrollbars */
.result-area {
    max-width: 100%;
}

.result-area img,
img.result-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

@media (max-width: 768px) {
    .images-comparison {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Note: result-card mobile styles are now handled by .app-container.is-mobile selectors */
}

/* Generate prompt styling */
.generate-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
}

.generate-prompt .placeholder-icon {
    font-size: 48px;
    color: var(--pastel-purple);
}

.generate-prompt p {
    font-size: 18px;
    color: #666;
    margin: 0;
}



.selection-pill {
    display: inline-block;
    padding: 6px 14px;
    background: var(--pill-color, var(--pastel-blue));
    color: var(--pill-text, #fff);
    border: 2px solid var(--text-dark);
    border-radius: 20px;
    box-shadow: 3px 3px 0 var(--text-dark);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.selection-pill.pending {
    position: relative;
    border: 2px dashed var(--text-dark);
    opacity: 0.85;
    box-shadow: none;
    background: var(--pill-color-light, var(--pill-color, #e4e4e4));
    color: var(--text-dark);
}

.generating .selection-pill.pending {
    position: relative;
    border: 2px dashed var(--text-dark);
    box-shadow: none;
    background: var(--pill-color, var(--pastel-blue));
    color: var(--pill-text, #fff);
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: pillLoading 1.5s linear infinite;
}

@keyframes pillLoading {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.selection-pill.removed {
    border: 2px dashed #999;
    color: #666;
    text-decoration: line-through;
    opacity: 0.65;
    box-shadow: none;
    background: var(--pill-color-light, #f0f0f0);
}


.loading-result {
    text-align: center;
    padding: 80px 20px;
}

/* Image with modifiers section - Character Card */
.result-card {
    display: inline-flex;
    flex-direction: column;
    border: 3px solid var(--text-dark);
    border-radius: 12px;
    box-shadow: 8px 8px 0 var(--text-dark); /* Neobrutalism shadow */
    background: white;
    transition: all 0.2s ease;
    width: auto;
    max-width: 90vw; /* Prevent card from exceeding viewport */
    overflow: hidden; /* Clip to border radius */
}

.result-image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(70vw, 100%);
    height: fit-content;
}

/* Image container */
.result-card img {
    display: block;
    width: auto;
    height: 60vh;
    max-width: 100%;
    border: none;
    margin: 0;
    padding: 0;
    object-fit: contain;
}

/* Wrapper to constrain pills width to image width */
.modifiers-pills-wrapper {
    display: flex;
    width: 100%;
    background: white;
    border-top: 3px solid var(--text-dark);
}

/* Modifiers section */
.modifiers-pills {
    flex-grow: 1;
    width: 0;
    padding: 16px 20px;
    margin: 0;
    box-sizing: border-box;
    text-align: center;
}

#imageModifiersSection {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Allow long modifier names to wrap inside the card */
.result-card .modifiers-pills .selection-pill {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: center;
    line-height: 1.2;
    padding: 6px 14px;
    margin: 4px 6px;
}

/* Removed result-container - no longer needed */

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 25px;
    border: 5px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Consistent button styling for all action buttons */
.result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.result-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 100px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

/* Make icons consistent size */
.result-actions button i.nf {
    font-size: 16px;
}

/* Copy button checkmark animation */
@keyframes checkmark-pop {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Success state for copy button */
.copy-btn.success {
    background: var(--pastel-green);
}

.copy-btn.success i.nf-md-check {
    display: inline-block;
    animation: checkmark-pop 0.4s ease-out;
}

/* Specific button colors - override defaults */
.result-actions .copy-btn {
    background: var(--pastel-purple);
}

.result-actions .download-btn {
    background: var(--pastel-green);
}

.result-actions .gallery-btn {
    background: var(--pastel-pink);
}

.result-actions .metadata-btn {
    background: var(--pastel-yellow);
    color: var(--text-dark);
}

.gallery-btn.saved {
    background: var(--pastel-purple-light);
    color: var(--text-dark);
    cursor: default;
}

.result-actions .generate-btn {
    background: var(--pastel-blue);
}

/* Special vivid Generate button when shown inline with description */
.result-info .generate-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 700;
    border: 2px solid var(--text-dark);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4), 3px 3px 0 var(--text-dark);
    animation: pulse-glow 2s infinite;
    transition: all 0.3s ease;
}

.result-info .generate-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.6), 5px 5px 0 var(--text-dark);
    animation: none;
}

.result-info .generate-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.4), 2px 2px 0 var(--text-dark);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.4), 3px 3px 0 var(--text-dark);
    }
    50% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.6), 3px 3px 0 var(--text-dark);
    }
}

.result-actions .force-generate-btn {
    background: var(--pastel-yellow);
}

/* Hover states - lift up and left */
.result-actions button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--text-dark);
}

/* Active/pressed state - push down and right */
.result-actions button:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 var(--text-dark);
}

.result-actions button:disabled {
    pointer-events: none;
    cursor: not-allowed;
    transform: none;
    box-shadow: 2px 2px 0 var(--text-dark);
    opacity: 0.9;
}

@media (min-width: 1000px) {
    .result-image-wrapper {
        position: relative;
        overflow: hidden;
    }

    .result-image-wrapper .result-actions {
        position: absolute;
        top: 10px;
        right: 12px;
        margin-top: 0;
        display: inline-flex;
        flex-direction: row;
        align-items: flex-start;
        justify-content: flex-end;
        gap: 8px;
        padding: 0;
        width: auto;
        max-width: calc(100% - 24px);
        flex-wrap: wrap;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-6px);
        transition: opacity 0.18s ease, transform 0.18s ease;
        z-index: 2;
    }

    .result-image-wrapper:hover .result-actions,
    .result-image-wrapper:focus-within .result-actions {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .result-image-wrapper .result-actions button {
        min-width: 0;
        padding: 6px 12px;
        font-size: 12px;
        gap: 6px;
        border: 2px solid var(--text-dark);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.88);
        color: var(--text-dark);
        box-shadow: 3px 3px 0 var(--text-dark);
        transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    }

    .result-image-wrapper .result-actions button i.nf {
        font-size: 13px;
    }

    .result-image-wrapper .result-actions button:hover {
        transform: translate(-2px, -2px);
        box-shadow: 5px 5px 0 var(--text-dark);
        background: rgba(255, 255, 255, 0.95);
    }

    .result-image-wrapper .result-actions button:active {
        transform: translate(1px, 1px);
        box-shadow: 2px 2px 0 var(--text-dark);
    }

    .result-image-wrapper .result-actions .copy-btn.success {
        background: var(--pastel-green);
    }
}

.modifiers-section {
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: calc(100% - 8px);
    overflow: visible;
    padding: 12px;
    padding-top: 16px;
    padding-right: 16px;
    border: 2px solid var(--text-dark);
    border-radius: 12px;
    box-shadow: 6px 6px 0 var(--text-dark);
    align-items: stretch;
    position: relative;
    z-index: 1;
    background: var(--category-color-background, #fff);
}

.modifiers-section .section-body {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

.modifiers-section.is-collapsed .section-body {
    display: none;
}

/* Position helpers */
.modifiers-section { position: relative; }
.random-btn {
    padding: 10px 20px;
    background: var(--pastel-purple);
    color: var(--text-dark);
    border: 2px solid var(--text-dark);
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s ease;
    white-space: nowrap;
    box-shadow: 3px 3px 0 var(--text-dark);
    text-transform: none; /* Ensure no uppercase */
}
.random-btn:hover {
    transform: translateY(-2px);
    box-shadow: 3px 5px 0 var(--text-dark);
}
.random-btn:active {
    transform: translateY(1px);
    box-shadow: 3px 2px 0 var(--text-dark);
}

/* removed old .modifiers-grid with inner scrollbars */

.modifier-button {
    padding: 8px 26px 8px 8px; /* more right padding for delete button */
    background: #fff;          /* default white background */
    border: 2px solid var(--text-dark); /* keep button border */
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    font-size: 15px;  /* slightly larger text */
    font-weight: 600;
    position: relative;
    min-height: 40px;
    display: inline-flex;  /* shrink-wrap to measured text */
    align-items: center;
    justify-content: center;
    box-shadow: 3px 3px 0 var(--text-dark);  /* Default shadow */
    width: auto;           /* size to content */
    line-height: 1.25;     /* improve readability */
    margin: 0;
    z-index: 1;  /* Base z-index for cards */
}

.modifiers-section .modifier-button.selected {
    background: var(--category-color, var(--category-color-light, #ffe0e0));
    color: var(--category-text-color, #fff);
}

.modifiers-section .modifier-button.cached:not(.selected) {
    background: var(--category-color-light, #f0f0f0);
    color: var(--text-dark);
}

.modifiers-section .modifier-button.cached.selected {
    background: var(--category-color, var(--category-color-light, #ffe0e0));
    color: var(--category-text-color, #fff);
}


.modifier-button .card-measure {
    visibility: hidden;    /* contributes width without showing */
    display: inline-block;
    white-space: nowrap;   /* prevent wrapping to measure true width */
}

.modifier-button .card-label {
    position: absolute;
    inset: 0;               /* fill the card */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 4px;        /* reduce side padding inside overlay */
    pointer-events: none;   /* clicks go to card */
}

.modifier-button .modifier-remove {
    position: absolute;
    top: 3px;          /* position inside the card */
    right: 3px;
    left: auto;         /* ensure it's on the right */
    bottom: auto;       /* ensure it's at the top */
    width: 18px;
    height: 18px;
    background: transparent;
    color: #666;
    border: none;
    border-radius: 6px; /* Subtle rounded corners */
    cursor: pointer;
    font-size: 14px;
    line-height: 16px;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    opacity: 0;         /* hidden until hover */
    transition: opacity 0.2s, background-color 0.2s;
    z-index: 10;     /* Above card content */
    pointer-events: none; /* don't intercept clicks when hidden */
    box-shadow: none; /* No shadow */
}

.modifier-button .modifier-remove:hover {
    background: rgba(0, 0, 0, 0.1); /* Grey background on hover */
    color: #333;
}

.modifier-button:not(.selected):hover .modifier-remove {
    opacity: 1;
    pointer-events: auto; /* clickable only when visible */
}

.modifier-button.selected .modifier-remove {
    display: none; /* Hide delete button when selected */
}

/* Cached option cards - cache indicator styling */
.modifier-button.cached {
    position: relative;
}

.modifier-button.cached .cache-indicator {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 14px;
    color: #999;
    opacity: 0.7;
}

.modifier-button.cached.selected .cache-indicator {
    color: rgba(255, 255, 255, 0.7);
}

/* Hover states for cached cards */
.modifiers-section .modifier-button.cached:not(.selected):hover {
    background: var(--category-color-light, #e0e0e0);
}

/* Adjust None card colors for better contrast */
.modifiers-section .modifier-button.none:not(.selected) {
    background: #f5f5f5;
}

.modifier-button.none .modifier-remove {
    display: none;
}

/* Modifier-remove button in uploaded cards */
.uploaded-card {
    position: relative;
}

.uploaded-card .modifier-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    left: auto;
    bottom: auto;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.85);
    color: #333;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    line-height: 20px;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.uploaded-card .modifier-remove:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.uploaded-card:hover .modifier-remove {
    opacity: 1;
    pointer-events: auto;
}

.add-card {
    padding: 0;
    background: transparent;
    border: 2px dashed var(--text-dark);
    border-radius: 12px;  /* Same as option cards */
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    position: relative;
    height: 45px;  /* Match actual option card height */
    width: 45px;   /* Perfect square */
    min-height: 45px;
    min-width: 45px;
    display: inline-flex;  /* Same as option cards */
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    box-shadow: none;
    box-sizing: border-box;
    margin: 0;  /* Ensure no margin affecting position */
}

/* Edit card styles - matching normal option cards */
.modifier-button.edit-card {
    padding: 8px 8px;  /* Same as normal modifier-button */
    background: #fff;
    border: 2px solid var(--text-dark);
    border-radius: 12px;  /* Same as normal modifier-button */
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 3px 3px 0 var(--text-dark);  /* Same shadow */
    min-height: 40px;  /* Same as normal modifier-button */
    min-width: 44px;  /* Same as + button */
    width: auto;  /* Natural width from content */
    position: relative;
    box-sizing: border-box;
    margin: 0;
    z-index: 1;
}

/* Character limit tooltip */
.char-limit-tooltip {
    position: absolute;
    top: -30px;
    right: 0;
    background: var(--text-dark);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

.char-limit-tooltip.show {
    opacity: 1;
}

.char-limit-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-dark);
}

.edit-input {
    border: none;
    outline: none;
    padding: 0 4px;  /* 4px padding on each side to match option cards */
    margin: 0;
    font-size: 15px;  /* Same as modifier-button */
    font-weight: 600;  /* Same as modifier-button */
    font-family: inherit;
    background: transparent;
    text-align: left;  /* Left align to prevent jumping */
    line-height: 1.25;  /* Same as modifier-button */
    display: inline-block;
    min-width: 10px;  /* Minimum width for cursor visibility */
    white-space: nowrap;  /* Prevent wrapping */
}

.edit-input:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.edit-input::selection {
    background: rgba(183, 148, 246, 0.3);
}

.edit-confirm {
    background: transparent;
    border: none;
    padding: 0 4px;
    cursor: pointer;
    transition: transform 0.15s ease;
    color: var(--text-dark);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    flex-shrink: 0;  /* Don't shrink */
}

.edit-confirm:hover {
    transform: scale(1.2);
    color: var(--text-dark);
    background: transparent !important;
}

.edit-confirm:hover i,
.edit-confirm i:hover {
    background: transparent !important;
}

.edit-confirm:active {
    transform: scale(1.1);
}

.add-card:hover {
    transform: scale(1.1);  /* Expand on hover */
    box-shadow: none;  /* No shadow change */
}

.add-card:active {
    transform: scale(0.95);  /* Shrink on click */
    box-shadow: none;  /* No shadow change */
}

.search-container {
    margin-bottom: 0;            /* sits inline with title now */
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Header row for each modifiers section: title + search on same line */
/* Title + search inline and responsive */
.section-title,
.section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap; /* allow wrapping on small widths */
    padding-left: 4px; /* Align with option cards below */
}
.section-toggle {
    background: none;
    border: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    padding: 0;
    text-align: left;
    box-shadow: none;
}
.section-toggle:hover,
.section-toggle:active {
    background: none !important;
    box-shadow: none;
}
.section-toggle:focus {
    box-shadow: none;
}
.section-toggle:focus-visible {
    outline: 2px solid var(--text-dark);
    outline-offset: 2px;
    border-radius: 6px;
}
.section-title .label,
.section-toggle .label {
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

/* Icon styling within section titles */
.section-title .label i,
.section-toggle .label i {
    font-size: 1.2rem; /* Bigger icon size */
    margin-right: 6px !important; /* Reduce margin slightly */
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}
.section-title .search-container {
    flex: 1 1 260px;  /* grow, but allow wrap */
    min-width: 160px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

/* Make header span full width in flex layout */
.modifiers-section .section-title,
.modifiers-section .section-toggle {
    width: 100%;
    margin: 0;
}

.section-toggle .chevron {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.section-toggle .chevron i {
    transition: transform 0.2s ease;
    transform: rotate(180deg);
}

.section-toggle:hover .chevron {
    transform: scale(1.1);
}

.modifiers-section.is-collapsed .section-toggle .chevron i {
    transform: rotate(0deg);
}

/* modifiers-list no longer used; sections themselves are grids */

.search-input {
    flex: 1 1 180px;   /* responsive width */
    min-width: 0;      /* allow shrink in flex */
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
    outline: none;
}

.unselect-all-btn {
    padding: 12px 16px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.unselect-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input::placeholder {
    color: #999;
    font-style: italic;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.modifier-button.none {
    background: #f0f0f0; /* Light gray background */
    border-color: var(--text-dark); /* Black border like other cards */
    font-weight: 700;
    color: var(--text-dark);
    padding: 8px 26px 8px 8px; /* Match other cards padding */
    box-shadow: 3px 3px 0 var(--text-dark); /* Same shadow as other cards */
}

.modifier-button:hover {
    transform: translate(-2px, -2px);  /* Lift up-left on hover */
    box-shadow: 5px 5px 0 var(--text-dark);  /* Bigger shadow to the bottom-right */
    border-color: var(--text-dark);  /* Keep border black */
    z-index: 100;  /* Higher z-index on hover to show delete button above other cards */
}

.modifier-button:active {
    transform: translate(1px, 1px);  /* Push down-right on click */
    box-shadow: 2px 2px 0 var(--text-dark);  /* Smaller shadow when pressed */
}

.modifier-button.selected {
    transform: translate(2px, 2px);  /* Pushed down-right when selected */
    box-shadow: 1px 1px 0 var(--text-dark); /* Smaller shadow for pushed effect */
    border-color: var(--text-dark); /* Keep border black */
    animation: none;
}

.modifier-button.selected:hover {
    transform: translate(2px, 2px);  /* Stay pushed on hover */
    box-shadow: 1px 1px 0 var(--text-dark); /* Keep same shadow */
}

.modifier-button.selected:active {
    transform: translate(3px, 3px);  /* Push even more on click */
    box-shadow: 0px 0px 0 var(--text-dark); /* No shadow when fully pushed */
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3), 0 10px 30px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 215, 0, 0.2), 0 10px 35px rgba(102, 126, 234, 0.6);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3), 0 10px 30px rgba(102, 126, 234, 0.5);
    }
}

/* None pill inherits category styling */
.modifiers-section .modifier-button.selected.none {
    background: var(--category-color, var(--category-color-light, #d9d9d9));
    border-color: var(--text-dark);
    color: var(--category-text-color, #fff);
}


.modifier-button.loading {
    opacity: 0.7;
    pointer-events: none;
}

.modifier-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
}

.nav-link {
    display: inline-block;
    margin-bottom: 20px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    padding: 10px 25px;
    border-radius: 30px;
    transition: all 0.3s;
    font-size: 15px;
}

.nav-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateX(-5px);
}

@media (max-width: 1400px) {
    .main-layout {
        grid-template-columns: 500px 1fr;
        gap: 25px;
    }
}

@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .photo-panel {
        min-height: 500px;
    }
    
    .modifiers-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        max-height: 300px;
    }
}

.default-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
    /* No container styling - grid only */
}

[data-mobile-tab-controls],
.mobile-base-panel {
    display: none;
}

.mobile-tab-button {
    appearance: none;
    border: none;
    background: transparent;
    font: inherit;
}

.default-image-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid var(--text-dark);
    aspect-ratio: 1;  /* Force all cards to be square */
    background: white;
    box-shadow: 5px 5px 0 var(--text-dark);
}

.default-image-card.upload-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--pastel-purple-light);
    border: 3px dashed var(--text-dark);
    aspect-ratio: 1;
    box-shadow: none;  /* No shadow for upload card */
}

.upload-card .upload-icon {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.upload-card .upload-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    padding: 0 10px;
}

.upload-card:hover {
    background: var(--pastel-purple);
    transform: translateY(-3px);
    box-shadow: none;  /* No shadow on hover */
}

.upload-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.upload-card.disabled:hover {
    transform: none;
    background: var(--pastel-purple-light);
}

.default-image-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.default-image-card.selected {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transform: translateY(-3px);
}

.default-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;  /* Crop to fill square */
    display: block;
}

.default-image-card .image-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 8px 6px 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.initial-menu {
    background: #fff;
    border: 3px solid var(--text-dark);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 8px 8px 0 var(--text-dark);  /* Neobrutalist shadow */
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.menu-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 700;
}

.menu-subtitle {
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1rem;
    line-height: 1.4;
}

.menu-modifiers {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.menu-option {
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 20px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.menu-option:hover:not(.disabled) {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.menu-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
}

.menu-option.disabled .menu-option-icon {
    opacity: 0.5;
}

.menu-option-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.menu-option-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.menu-option-subtitle {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.coming-soon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff6b6b;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}


.initial-menu {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.initial-menu.fade-out {
    opacity: 0;
}

/* Carousel Section Styles */
.style-carousel-section {
    margin: 60px auto;
    max-width: 1200px;
    padding: 0 20px;
}

.carousel-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    background: white;
    display: inline-block;
    padding: 12px 24px;
    border: 3px solid var(--text-dark);
    border-radius: 12px;
    box-shadow: 5px 5px 0 var(--text-dark);
    margin: 0 auto 40px;
    text-transform: uppercase;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.carousel-title i {
    color: var(--color-accessory);
    margin-right: 8px;
}

.style-carousel {
    overflow-x: auto;
    padding: 20px 0 40px;
    margin: 0 -20px;
    scrollbar-width: thin;
    scrollbar-color: var(--text-dark) transparent;
}

.style-carousel::-webkit-scrollbar {
    height: 8px;
}

.style-carousel::-webkit-scrollbar-track {
    background: transparent;
}

.style-carousel::-webkit-scrollbar-thumb {
    background: var(--text-dark);
    border-radius: 4px;
}

.carousel-track {
    display: flex;
    gap: 20px;
    padding: 0 20px;
    width: max-content;
}

.carousel-item {
    width: 280px;
    height: 380px;
    border: 3px solid var(--text-dark);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 5px 5px 0 var(--text-dark);
    display: flex;
    align-items: flex-end;
    flex-shrink: 0;
}

.carousel-item:hover {
    transform: translateY(-5px);
    box-shadow: 8px 8px 0 var(--text-dark);
}

.carousel-item.active {
    width: 400px;
    transform: translateY(-10px);
    box-shadow: 10px 10px 0 var(--text-dark);
}

.carousel-item::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    pointer-events: none;
}

.carousel-item .item-desc {
    padding: 20px;
    color: white;
    position: relative;
    z-index: 1;
    transform: translateY(calc(100% - 60px));
    transition: all 0.3s ease;
}

.carousel-item.active .item-desc {
    transform: translateY(0);
}

.carousel-item .item-desc h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.carousel-item .item-desc p {
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease 0.1s;
}

.carousel-item.active .item-desc p {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .carousel-item {
        width: 240px;
        height: 320px;
    }

    .carousel-item.active {
        width: 300px;
    }

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

.back-button {
    background: rgba(255,255,255,0.9);
    border: 2px solid #667eea;
    color: #667eea;
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    margin-bottom: 20px;
    display: inline-block;
    text-decoration: none;
}

.back-button:hover {
    background: #667eea;
    color: white;
    transform: translateX(-5px);
}


@media (max-width: 768px) {
    .modifiers-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .modifier-button {
        padding: 10px 6px;
        font-size: 12px;
        min-height: 45px;
    }
    
    .default-images-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .menu-modifiers {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .menu-option {
        min-height: 150px;
        padding: 25px 15px;
    }

    .menu-option-icon {
        font-size: 2.5rem;
    }
}

/* Simple Responsive */
@media (max-width: 1200px) {
    .base-image-picker {
        width: 280px;
    }
    
    .modifiers-picker {
        width: 350px;
    }
    
    .result-area {
        width: auto;
        height: auto;
        max-width: min(92vw, 800px);
    }
}

@media (max-width: 1024px) and (min-width: 1000px) {
    .result-area {
        width: auto;
        height: auto;
        max-width: min(94vw, 720px);
    }
}


@media (max-width: 999px) {
    .navbar {
        display: none;
    }

    .main-interface {
        top: 0;
        height: 100dvh;
        min-height: 100vh;
    }

    .main-interface.is-mobile {
        flex-direction: column;
        top: 0;
        height: 100dvh;
        min-height: 100vh;
        overflow: hidden;
        padding: 0;
    }

    .app-container.is-mobile {
        flex-direction: column;
        height: 100%;
        min-height: 0;
        overflow: hidden;
        gap: 0;
    }

    .app-container.is-mobile [data-base-picker] {
        order: 1;
        width: 100%;
        max-width: 100%;
        border: 2px solid var(--text-dark);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.95);
        margin-bottom: 12px;
        flex: 0 0 auto;
    }

    .app-container.is-mobile [data-mobile-base-slot] {
        display: block;
        margin: 0 0 16px;
    }

    .app-container.is-mobile [data-mobile-base-slot][hidden] {
        display: none;
    }

    .app-container.is-mobile #rightResizer,
    .main-interface.is-mobile #rightResizer,
    .app-container.is-mobile .resizer-right {
        display: none;
    }

    .app-container.is-mobile .modifiers-picker .mobile-tab-controls {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        width: auto;
    }

    .app-container.is-mobile .mobile-tab-button {
        border: 2px solid var(--text-dark);
        border-radius: 12px;
        padding: 8px 14px;
        font-weight: 700;
        font-size: 13px;
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 3px 3px 0 var(--text-dark);
        color: var(--text-dark);
        cursor: pointer;
        transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    }

    .app-container.is-mobile .mobile-tab-button:hover {
        transform: translate(-2px, -2px);
        box-shadow: 5px 5px 0 var(--text-dark);
    }

    .app-container.is-mobile .mobile-tab-button.is-active {
        background: #00ff88;
        transform: translate(0, 0);
        box-shadow: none;
    }

    .app-container.is-mobile .mobile-tab-button.is-active:active {
        transform: translate(1px, 1px);
    }

    .app-container.is-mobile .center-content {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        padding: 16px 12px 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;
        overflow: hidden;
    }

    .app-container.is-mobile .result-stack {
        flex: 1 1 auto;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        overflow: hidden;
        max-height: 100%;
        min-height: 0;
    }

    .app-container.is-mobile .result-area {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px;
        overflow: hidden;
        flex: 1 1 auto;
        max-height: 100%;
        min-height: 0;
    }

    .app-container.is-mobile .result-card {
        display: inline-flex;
        flex-direction: column;
        width: fit-content;
        max-width: 100%;
        border-width: 2px;
        box-shadow: 4px 4px 0 var(--text-dark);
        transform: none;
        background: white;
        align-self: center;
        flex: 1 1 auto;
        flex-shrink: 1;
        max-height: calc(100vh - 120px);
        max-height: calc(100dvh - 120px);
        overflow: hidden;
    }

    .app-container.is-mobile .result-card .result-image-wrapper {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 90vw;
        height: auto;
        flex: 1 1 auto;
        max-height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .app-container.is-mobile .result-card img {
        display: block;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .app-container.is-mobile .result-card .modifiers-pills-wrapper {
        flex: 0 0 auto;
        width: auto !important;
        max-height: 30%;
        overflow-y: auto;
        border-top: 2px solid var(--text-dark);
    }

    .app-container.is-mobile .result-card .modifiers-pills {
        padding: 8px 12px;
        gap: 6px;
    }

    .app-container.is-mobile .result-card .selection-pill {
        font-size: 11px;
        padding: 4px 8px;
    }

    .app-container.is-mobile .result-actions {
        display: none;
    }

    /* Fullscreen image popup for mobile */
    .fullscreen-image-popup {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.95);
        z-index: 9999;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    .fullscreen-image-popup.active {
        display: flex;
    }

    .fullscreen-image-popup img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
        display: block;
    }

    .fullscreen-image-popup .close-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        background: white;
        border: 3px solid var(--text-dark);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 4px 4px 0 var(--text-dark);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        z-index: 10000;
    }

    .fullscreen-image-popup .close-btn:hover {
        transform: translate(-2px, -2px);
        box-shadow: 6px 6px 0 var(--text-dark);
    }

    .fullscreen-image-popup .close-btn:active {
        transform: translate(1px, 1px);
        box-shadow: 2px 2px 0 var(--text-dark);
    }

    .fullscreen-image-popup .close-btn i {
        font-size: 20px;
        color: var(--text-dark);
    }

    .app-container.is-mobile .modifiers-picker {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        border-left: none;
        border-right: none;
        border-bottom: none;
        border-top: 2px solid var(--text-dark);
        height: 100%;
        max-height: none;
        overflow: hidden;
        width: 100%;
        max-width: 100%;
    }

    .app-container.is-mobile .modifiers-picker .sidebar-header {
        padding: 8px 16px;
        height: auto;
        min-height: unset;
        align-items: center;
        gap: 12px;
    }

    .app-container.is-mobile .modifiers-picker .header-title-group {
        display: flex;
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }

    .app-container.is-mobile .modifiers-picker .header-actions {
        gap: 8px;
        align-items: center;
    }

    .app-container.is-mobile .modifiers-picker .header-actions button {
        padding: 4px 10px;
        font-size: 11px;
    }

    .app-container.is-mobile .modifiers-picker .header-actions .reset-btn,
    .app-container.is-mobile .modifiers-picker .header-actions .random-btn {
        padding: 6px 10px;
        min-width: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
    }

    .app-container.is-mobile .modifiers-picker .header-actions .reset-btn .button-label,
    .app-container.is-mobile .modifiers-picker .header-actions .random-btn .button-label {
        display: none;
    }

    .app-container.is-mobile .modifiers-picker .header-actions .reset-btn i,
    .app-container.is-mobile .modifiers-picker .header-actions .random-btn i {
        margin-right: 0;
    }

    .app-container.is-mobile .modifiers-picker .sidebar-title {
        display: none;
    }

    .app-container.is-mobile [data-mobile-tab-panel] {
        display: none;
    }

    .app-container.is-mobile [data-mobile-tab-panel].mobile-tab-active {
        display: flex;
    }

    .app-container.is-mobile [data-mobile-tab-panel="modifiers"].mobile-tab-active {
        flex: 1 1 auto;
        overflow-y: auto;
        padding: 16px 16px 24px;
        align-items: stretch;
        text-align: left;
    }

    .app-container.is-mobile [data-mobile-tab-panel="modifiers"].mobile-tab-active.has-footer {
        padding-bottom: 120px;
    }

    .app-container.is-mobile .modifiers-pills {
        text-align: left;
    }

    .app-container.is-mobile .mobile-base-panel.mobile-tab-active {
        flex: 1 1 auto;
        flex-direction: column;
        overflow-y: auto;
        padding: 16px 16px 80px;
        gap: 16px;
    }

    .app-container.is-mobile .modifiers-picker .sidebar-footer {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(100%);
        border-top: 0;
        background: rgba(255, 255, 255, 0.97);
        padding: 0;
        margin-top: 0;
        height: 0;
        overflow: hidden;
        box-shadow: none;
        transition: transform 0.2s ease-out, opacity 0.2s ease-out, height 0.2s ease-out, padding 0.2s ease-out, margin-top 0.2s ease-out, border 0.2s ease-out, box-shadow 0.2s ease-out;
        z-index: 15;
    }

    .app-container.is-mobile .modifiers-picker .sidebar-footer.initialized {
        visibility: hidden;
        height: 0;
        padding: 0;
    }

    .app-container.is-mobile .modifiers-picker .sidebar-footer.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        justify-content: center;
        height: auto;
        padding: 14px 16px 18px;
        margin-top: auto;
        border-top: 2px solid var(--text-dark);
        box-shadow: 0 -4px 0 rgba(45, 45, 45, 0.1);
    }

    .app-container.is-mobile .modifiers-picker .sidebar-footer.mobile-hidden {
        display: none;
    }

    .app-container.is-mobile .modifiers-picker .generate-btn {
        width: auto;
        min-width: 160px;
        max-width: 80%;
        align-self: center;
    }

    .app-container.is-mobile .sidebar-toggle {
        display: none;
    }

    .app-container.is-mobile .modifiers-section {
        padding: 10px;
        margin-bottom: 16px;
        text-align: left;
    }

    .app-container.is-mobile .modifiers-section .section-title,
    .app-container.is-mobile .modifiers-section .section-toggle {
        font-size: 13px;
        margin: 0;
    }

    .app-container.is-mobile .modifiers-section .section-title .label,
    .app-container.is-mobile .modifiers-section .section-toggle .label {
        font-size: 13px;
    }

    .app-container.is-mobile .modifiers-section .section-title .label i,
    .app-container.is-mobile .modifiers-section .section-toggle .label i {
        font-size: 16px;
        margin-right: 6px;
    }

    .app-container.is-mobile .modifier-button {
        padding: 10px 8px;
        font-size: 12px;
    }

    .app-container.is-mobile .modifier-button img {
        height: 56px;
    }

    .app-container.is-mobile .modifier-button .modifier-remove {
        display: none;
    }

    .app-container.is-mobile .action-buttons button {
        padding: 10px 14px;
        font-size: 13px;
    }

    .app-container.is-mobile .base-image-picker {
        border: none;
    }

    .app-container.is-mobile .modifiers-picker {
        border-left: none;
    }

    .app-container.is-mobile [data-mobile-base-slot] .base-image-picker .sidebar-header {
        display: none;
    }

    .app-container.is-mobile [data-mobile-base-slot] .base-image-picker .sidebar-content {
        padding: 0;
        height: auto;
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow: visible;
        border: none;
    }

    .app-container.is-mobile [data-mobile-base-slot] .sidebar-section {
        margin-bottom: 0;
        display: block;
        padding: 12px 16px;
        height: auto;
        flex: 1;
        overflow: visible;
    }

    .app-container.is-mobile [data-mobile-base-slot] .section-title {
        font-size: 14px;
        margin-bottom: 10px;
        display: flex;
        align-items: center;
        gap: 8px;
        text-align: left;
    }

    .app-container.is-mobile [data-mobile-base-slot] .sidebar-images-grid {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding: 8px;
        padding-bottom: 12px;
    }

    .app-container.is-mobile [data-mobile-base-slot] #sidebarUploadsSeparator {
        margin: 12px 0 8px;
        border-top-style: solid;
    }

    .app-container.is-mobile [data-mobile-base-slot] .sidebar-images-grid .image-option,
    .app-container.is-mobile [data-mobile-base-slot] .sidebar-images-grid img,
    .app-container.is-mobile [data-mobile-base-slot] .sidebar-images-grid .upload-photo-btn {
        flex: 0 0 auto;
        width: 72px;
        height: 72px;
    }

    .app-container.is-mobile [data-mobile-base-slot] .sidebar-images-grid .upload-photo-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .app-container.is-mobile [data-mobile-base-slot] .sidebar-images-grid .upload-photo-btn .upload-photo-icon {
        font-size: 22px;
    }

    .app-container.is-mobile [data-mobile-base-slot] .sidebar-images-grid .upload-photo-btn .upload-photo-label {
        font-size: 0.75rem;
    }

    .app-container.is-mobile [data-mobile-base-slot] .user-uploads-grid {
        display: flex;
    }

    .app-container.is-mobile [data-mobile-base-slot] .uploaded-card:hover {
        box-shadow: 3px 3px 0 var(--text-dark);
    }

    .app-container.is-mobile [data-mobile-base-slot] .uploaded-card.selected {
        box-shadow: 3px 3px 0 var(--text-dark);
    }

    .app-container.is-mobile [data-mobile-base-slot] .uploaded-card:active {
        box-shadow: 3px 3px 0 var(--text-dark);
    }

    .app-container.is-mobile [data-mobile-base-slot] .uploaded-card,
    .app-container.is-mobile [data-mobile-base-slot] .uploaded-thumb {
        border: none;
    }

    .app-container.is-mobile [data-mobile-base-slot] .user-uploads-grid {
        flex-wrap: nowrap;
        gap: 10px;
        overflow-x: auto;
        margin-top: 12px;
    }

    .app-container.is-mobile [data-mobile-base-slot] .user-uploads-grid .uploaded-card {
        flex: 0 0 72px;
        width: 72px;
        min-width: 72px;
        height: 72px;
        border: 2px solid var(--text-dark);
        border-radius: 12px;
        box-shadow: 3px 3px 0 rgba(45, 45, 45, 0.25);
        transform: none !important;
        transition: box-shadow 0.2s ease, transform 0.2s ease;
    }

    .app-container.is-mobile [data-mobile-base-slot] .user-uploads-grid .uploaded-card.selected {
        transform: translate(-3px, -3px) !important;
        box-shadow: 5px 5px 0 rgba(45, 45, 45, 0.3);
    }

    .app-container.is-mobile [data-mobile-base-slot] .user-uploads-grid .uploaded-card:hover {
        transform: translate(-2px, -2px) !important;
    }

    .app-container.is-mobile [data-mobile-base-slot] .user-uploads-grid .uploaded-card:active {
        transform: translate(1px, 1px) !important;
    }

    .app-container.is-mobile [data-mobile-base-slot] .user-uploads-grid .uploaded-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .app-container.is-mobile [data-mobile-base-slot] .user-uploads-grid .uploaded-card .modifier-remove {
        display: none;
    }

    .app-container.is-mobile [data-mobile-base-slot] .sidebar-footer {
        display: none;
    }

}

/* Neobrutalist Confirmation Popover */
.confirm-popover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 10000;
    pointer-events: auto;
}

.confirm-popover {
    position: absolute;
    background: var(--white);
    border: 2px solid var(--text-dark);
    border-radius: 12px;
    box-shadow: 4px 4px 0 rgba(45, 45, 45, 0.3);
    max-width: 240px;
    width: max-content;
    min-width: 160px;
    animation: popIn 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    from {
        transform: translateY(10px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.confirm-popover-content {
    padding: 12px 16px;
}

.confirm-popover-message {
    font-size: 13px;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.3;
    font-weight: 500;
    text-align: center;
}

.confirm-popover-actions {
    display: flex;
    justify-content: center;
}

.confirm-btn {
    padding: 6px 14px;
    border: 2px solid var(--text-dark);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.confirm-btn-delete {
    background: #ff6b6b;
    color: var(--white);
    border-color: var(--text-dark);
}

.confirm-btn-delete:hover {
    background: #ff5252;
    transform: translateY(-1px);
    box-shadow: 3px 3px 0 rgba(45, 45, 45, 0.3);
}

.confirm-btn:active {
    transform: translateY(0);
    box-shadow: 2px 2px 0 rgba(45, 45, 45, 0.2);
}

/* Developer metadata modal */
.metadata-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.55);
    z-index: 11000;
}

.metadata-modal.active {
    display: flex;
}

.metadata-modal-content {
    background: #ffffff;
    color: var(--text-dark);
    border: 2px solid var(--text-dark);
    box-shadow: 8px 8px 0 rgba(45, 45, 45, 0.25);
    border-radius: 16px;
    width: min(720px, 100%);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.metadata-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px solid var(--text-dark);
    background: var(--pastel-purple-light);
}

.metadata-modal-header h2 {
    font-size: 18px;
    margin: 0;
    font-weight: 700;
}

.metadata-modal-close {
    background: transparent;
    border: none;
    color: var(--text-dark);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.metadata-modal-body {
    padding: 0;
    overflow: auto;
    flex: 1;
    background: #f9f9ff;
}

.metadata-modal-pre {
    margin: 0;
    padding: 20px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, monospace;
}

.metadata-modal-message {
    margin: 0;
    padding: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.metadata-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 2px solid var(--text-dark);
    background: #ffffff;
}

.metadata-modal-btn {
    padding: 10px 18px;
    border: 2px solid var(--text-dark);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
}

.metadata-modal-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(45, 45, 45, 0.25);
}

.metadata-modal-btn-cancel {
    background: var(--pastel-purple-light);
    color: var(--text-dark);
}

.metadata-modal-btn-proceed {
    background: var(--pastel-green);
    color: var(--text-dark);
}

.metadata-modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 3px 3px 0 rgba(45, 45, 45, 0.25);
}

.metadata-modal-btn:active {
    transform: translateY(0);
    box-shadow: 2px 2px 0 rgba(45, 45, 45, 0.18);
}
