/* static/css/style.css */

/* Import modular stylesheets */
@import url('_variables.css');
@import url('_base.css');
@import url('_layout.css');
@import url('_header.css');
@import url('_sidebar.css');
@import url('_auth.css');
@import url('_image-generator.css');
@import url('_gallery.css');
@import url('_profile.css');
@import url('_modals.css');
@import url('_utilities.css');
@import url('_success.css');
@import url('cart.css');

/* Add any global overrides or very specific styles below if necessary */

/* Logo link styling */
header h1 a#site-logo {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

header h1 a#site-logo:hover {
    color: inherit;
}

/* Explore-related styles are now in _gallery.css */

/* Jobs indicator styles */
.jobs-indicator {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    position: relative;
    cursor: pointer;
    z-index: 1005;
    vertical-align: middle;
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

.jobs-count {
    background-color: #f44336;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    margin-left: 4px;
    font-weight: bold;
}

.jobs-tooltip {
    visibility: hidden;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1006;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.jobs-indicator:hover .jobs-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Sidebar Jobs Progress Bar */
.sidebar-jobs-progress {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    box-sizing: border-box;
    width: 100%;
    max-width: 216px; /* 240px sidebar - 24px for safe margin */
    flex-shrink: 0;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
}

.jobs-progress-label {
    color: #ccc;
    font-size: 12px;
    margin-bottom: 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.jobs-progress-bar {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    height: 6px;
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 192px; /* 216px container - 24px padding */
    box-sizing: border-box;
    min-width: 0;
    margin: 0 auto;
}

.jobs-progress-fill {
    background: linear-gradient(90deg, #F27BBD, #874CCC, #10439F);
    height: 100%;
    width: 0%;
    max-width: 100%;
    border-radius: 8px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    min-width: 0;
}

.jobs-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: progress-shine 2s infinite;
    transform: translateX(0); /* Constrain animation */
    overflow: hidden;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Mobile Jobs Progress Bar - Top Header Overlay (Always Visible) */
.mobile-jobs-progress {
    display: none; /* Hidden by default */
    position: fixed;
    left: 0;
    right: 0;
    bottom: 70px; /* sits just above bottom nav (nav height = 70px) */
    z-index: 1004; /* Above bottom nav */
    background-color: rgba(0, 0, 0, 0);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 6px 16px;
    pointer-events: none; /* allow taps through except on bar */
}

/* Explicitly hide mobile progress bar on desktop */
@media (min-width: 769px) {
    .mobile-jobs-progress {
        display: none !important;
    }
}

.mobile-jobs-progress-bar {
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    height: 3px;
    overflow: visible;
    position: relative;
    width: 100%;
}

.mobile-jobs-progress-fill {
    background: linear-gradient(90deg, #F27BBD, #874CCC, #10439F);
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mobile-jobs-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    animation: progress-shine 3s infinite;
}

/* Mobile progress bar text */
.mobile-jobs-progress-text {
    display: none !important; /* Hidden per requirement */
}

/* Mobile jobs progress is controlled by JavaScript - no automatic display override needed */

/* Mobile Header Base Styles */
.mobile-header {
    /* header placeholder */
    position: relative; /* keep non-empty for linter */
}

.header-content {
    /* content wrapper */
    display: flex; /* ensures children layout properly */
    justify-content: space-between;
    align-items: center;
}

/* Old mobile-explore-progress styles removed - using real mobile-jobs-progress instead */

/* Old generic mobile-page-progress styles removed - using real mobile-jobs-progress instead */

/* Mobile responsive styles */
@media (max-width: 768px) {
    /* Hide sidebar progress on mobile - mobile jobs progress is controlled by JavaScript */
    .sidebar-jobs-progress {
        display: none !important;
    }
    
    /* Mobile jobs progress visibility is controlled by JavaScript */
}

/* Jobs modal */
#jobs-modal .modal-content {
    max-width: 500px;
    padding: 20px;
}

#jobs-list {
    max-height: 300px;
    overflow-y: auto;
}

.job-item {
    border-bottom: 1px solid #ddd;
    padding: 10px 0;
}

.job-item:last-child {
    border-bottom: none;
}

.job-prompt {
    font-weight: bold;
    margin-bottom: 5px;
}

.job-status {
    color: #666;
    margin-bottom: 3px;
}

.job-time {
    font-size: 0.8em;
    color: #999;
}

/* Template dropdown styles */
.template-dropdown-container {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.template-select {
    display: flex;
    align-items: center;
    margin-left: 5px;
}

#template-menu-btn {
    background: transparent;
    color: #ccc;
    border: none;
    padding: 5px;
    width: 34px;
    height: 34px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

#template-menu-btn:focus {
    outline: none;
}

#template-menu-btn:hover {
    color: #fff;
}

#template-menu-btn svg {
    width: 24px;
    height: 24px;
}

#template-menu {
    display: none;
    position: absolute;
    background-color: #333;
    min-width: 150px;
    border-radius: 4px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 1000;
    outline: none;
}

#template-menu:focus,
#template-menu:focus-visible,
#template-menu:focus-within {
    outline: none;
}

#template-menu a {
    color: #ccc;
    padding: 8px 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

#template-menu a svg {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

#template-menu a:hover {
    background-color: #444;
}

#template-menu a.active {
    background-color: #555;
    color: white;
}

#template-menu a:focus,
#template-menu a:focus-visible {
    outline: none;
}

/* Template data-type specific styles */
#template-menu a svg {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

/* Aspect ratio button and menu */
.aspect-ratio-selector {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    width: 44px;
    padding: 0;
}

#aspect-ratio-btn {
    background: transparent;
    color: #ccc;
    border: none;
    width: 100%;
    height: 100%;
    padding: 0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

#aspect-ratio-btn:hover {
    color: #fff;
}

/* Disabled aspect ratio (desktop) */
#aspect-ratio-btn[disabled] {
    color: var(--text-tertiary);
    opacity: 0.5;
    cursor: not-allowed;
}

#aspect-ratio-btn[disabled]:hover {
    color: var(--text-tertiary);
}

#aspect-ratio-btn svg {
    width: 24px;
    height: 24px;
}

/* Modify the SVG based on the aspect ratio */
#aspect-ratio-btn[data-ratio="1:1"] svg rect {
    width: 18px;
    height: 18px;
}

#aspect-ratio-btn[data-ratio="3:2"] svg rect {
    width: 18px;
    height: 12px;
}

#aspect-ratio-btn[data-ratio="2:3"] svg rect {
    width: 12px;
    height: 18px;
}

#aspect-ratio-menu {
    display: none;
    position: fixed;
    z-index: 2000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    min-width: 200px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.3);
}

#aspect-ratio-menu a {
    color: var(--text-primary);
    padding: 8px 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#aspect-ratio-menu a svg {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

#aspect-ratio-menu a:hover {
    background-color: var(--hover-bg);
}

#aspect-ratio-menu a.active {
    /* Keep the same text color as other items; use checkmark to indicate selection */
    color: var(--text-primary);
    font-weight: 600;
}

#aspect-ratio-menu a .checkmark {
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #ffffff;
}

#aspect-ratio-menu a.active .checkmark {
    opacity: 1;
}

/* Upload thumbnail container */
.upload-thumbnail-container {
    display: none; /* Hidden by default */
    width: 30px;
    height: 30px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 5px;
}

.upload-thumbnail-container.visible {
    display: block;
}

.upload-thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    min-height: 50px;
}

.upload-thumbnails > div {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.upload-thumbnails img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.thumbnail-remove:hover {
    background: rgba(255,0,0,0.7);
}

.generate-form-images-row {
    display: none;
    margin-bottom: 10px;
}

.generate-form-images-row.has-image {
    display: block;
}

/* For dark mode */
body.dark-mode .upload-thumbnails > div {
    border-color: #444;
}

body.dark-mode .thumbnail-remove {
    background: rgba(255,255,255,0.6);
    color: #000;
}

body.dark-mode .thumbnail-remove:hover {
    background: rgba(255,0,0,0.7);
    color: #fff;
}

#upload-btn {
    position: relative;
}

#upload-btn.has-images::after {
    content: attr(data-count);
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #3498db;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

body.dark-mode #upload-btn.has-images::after {
    background-color: #555; /* Darker background for dark mode */
    border-color: #666; /* Darker border for dark mode */
    color: #ccc; /* Lighter text for dark mode */
}

/* Styles for the overlay buttons container */
#overlay-buttons-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* This rule is now empty to avoid the !important override */
#overlay-buttons-container .dropdown-content { /* keep valid, previously empty */
    /* intentionally left with subtle style to satisfy linter */
    background: var(--bg-primary);
}

#overlay-buttons-container #sort-dropdown {
    min-width: 200px; /* Example width */
}

#overlay-buttons-container .profile-dropdown .dropdown-content {
    right: 0; /* Aligns the dropdown to the right of the profile button */
    /* You might need to adjust min-width or width if it looks off */
}

#overlay-buttons-container .cart-button {
    position: relative;
}

/* Adjust if the user-info span itself needs specific flex behavior */
#overlay-buttons-container #user-info {
    display: flex; /* If it contains multiple items you want to align */
    align-items: center;
}

/* Screen-reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* New Sort/Filter Button Styles */
#overlay-buttons-container .filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px; 
    height: 44px; 
    padding: 4px; 
    border-radius: 50%;
    background-color: rgba(var(--bg-primary-rgb), 0.85); /* Same as auth forms */
    backdrop-filter: blur(10px); /* Add background blur like auth forms */
    -webkit-backdrop-filter: blur(10px); /* Safari prefix */
    border: 1px solid rgba(var(--border-color-rgb, 255, 255, 255), 0.1); /* Same border as auth forms */
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, backdrop-filter 0.2s ease;
    color: var(--text-primary); /* Use theme text color */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

#overlay-buttons-container .filter-btn:focus {
    outline: none; /* Remove default focus outline if custom styling is sufficient */
    /* Add a custom focus indicator if desired, e.g., a box-shadow */
    /* box-shadow: 0 0 0 2px var(--focus-ring-color, #007bff); */
}

#overlay-buttons-container .filter-btn-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

#overlay-buttons-container .filter-btn-icon {
    width: 24px;
    height: 24px;
}

/* Make cart icon 20% smaller than filter icon for desktop */
#cart-btn .filter-btn-icon {
    width: 19px;
    height: 19px;
}

/* Dark mode adjustments for the new filter button */
body.dark-mode #overlay-buttons-container .filter-btn {
    /* Background and border are handled by CSS variables, no override needed */
    color: var(--text-primary); /* Use theme text color for dark mode */
}

body.dark-mode #overlay-buttons-container .filter-btn:hover .filter-btn-inner,
body.dark-mode #overlay-buttons-container .filter-btn:focus .filter-btn-inner {
    background-color: var(--bg-primary); /* Same hover effect for dark mode */
}

.register-link-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
  text-decoration: underline;
  margin-top: 0px;
  padding: 0px;
  display: block;
  width: 100%;
  text-align: left;
}
.register-link-btn:hover {
  background-color: #444;
}

/* When the login toggle is shown in register mode, match forgot-password hover */
#login-btn.register-link-btn:hover {
  background-color: transparent;
  color: var(--text-primary);
}

/* Individual Image Page Styles */
#image-section {
    padding: var(--space-xl);
    background-color: black;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100%;
    height: 100vh;
    gap: var(--space-xl);
}

#image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
}

#image-content {
    width: 100%;
    height: 100%;
}

.image-page-grid {
    display: grid;
    grid-template-columns: 1fr minmax(360px, 1fr);
    grid-template-rows: 1fr auto;
    grid-template-areas: 
        "image shop"
        "info shop";
    gap: 30px;
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 140px);
    cursor: default; /* Reset cursor for content */
}

.image-display {
    grid-area: image;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 85vw;
    max-height: 85vh;
    overflow: visible;
}

.main-image {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    object-fit: contain;
}

.image-info-section {
    grid-area: info;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;
    /* Set a minimum width for portrait images, but allow wider for landscape */
    width: 400px; /* Default width, will be overridden by JS for landscape images */
    max-width: 100%;
    margin-top: -20px; /* Move info section higher up to avoid generate window */
    align-self: start; /* Align to start of grid area */
    position: relative;
    z-index: 10; /* Ensure it's below the generator (z-index: 20) but above other content */
    margin-bottom: 120px; /* Add space to prevent overlap with fixed generator */
}

.creator-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.image-username {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 400;
}

.creator-info .share-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 28px;
}

.creator-info .share-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.creator-info .share-btn svg {
    width: 16px;
    height: 16px;
}

/* Ensure mockup controls button is visible on dark theme */
#mockup-controls .share-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 28px;
}

#mockup-controls .share-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.creator-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.creator-info .like-btn {
    background: rgba(0, 0, 0, 0.3); /* Match username background */
    border: none; /* Remove border to match username */
    color: #FFFFFF; /* Match username color */
    padding: 4px 10px; /* Match username padding */
    border-radius: 16px; /* Already matches username */
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem; /* Match username font size */
    font-weight: 600; /* Match username font weight */
    display: flex;
    align-items: center;
    gap: 4px; /* Consistent gap */
    line-height: 1.2; /* Match username line height */
}

.creator-info .like-btn:hover {
    background: rgba(255, 255, 255, 0.2); /* Match username hover style */
    color: #FFFFFF;
    transform: scale(1.05); /* Match username hover transform */
}

.creator-info .like-btn.liked {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.2); /* Slightly more visible when liked */
}

.creator-info .like-btn.liked:hover {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.3); /* Slightly more visible on hover when liked */
    transform: scale(1.05); /* Consistent hover transform */
}

.creator-info .like-btn svg {
    width: 14px; /* Match gallery like button size */
    height: 14px;
}

.creator-info .like-btn.liked svg path {
    fill: #ff4757;
}

.creator-info .like-count {
    font-size: 0.875rem; /* Match button font size */
    font-weight: 600; /* Match button font weight */
}

.privacy-indicator {
    font-size: 12px;
    opacity: 0.7;
}

.prompt-container {
    flex: 1;
    min-height: 0;
}

.image-prompt {
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    display: -webkit-box;
    line-clamp: 3; /* standard property */
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}

.image-prompt.expanded {
    display: block;
    line-clamp: unset;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.prompt-expand-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    margin-top: 5px;
    padding: 0;
    text-decoration: underline;
}

.prompt-expand-btn:hover {
    color: #ccc;
}

.image-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.like-btn, .share-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.3); /* Match username background */
    border: none; /* Remove border to match username */
    color: #FFFFFF; /* Match username color */
    padding: 4px 10px; /* Match username padding */
    border-radius: 16px; /* Match username border radius */
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem; /* Match username font size */
    font-weight: 600; /* Match username font weight */
    line-height: 1.2; /* Match username line height */
}

.like-btn:hover:not(.disabled), .share-btn:hover {
    background: rgba(255, 255, 255, 0.2); /* Match username hover style */
    color: #FFFFFF;
    transform: scale(1.05); /* Match username hover transform */
}

.like-btn.liked {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.2); /* Consistent with creator-info like button */
}

.like-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

.shopping-section {
    grid-area: shop;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    height: fit-content;
    max-height: 100vh;
    overflow-y: auto;
    justify-self: center; /* Center within the right-side space */
    width: 360px; /* Keep consistent panel width */
}

.poster-info h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.poster-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.poster-details > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.poster-details .label {
    color: #888;
    font-size: 14px;
}

.poster-details .value {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.shopify-container {
    margin-top: auto;
}

.buy-button {
    background: linear-gradient(90deg, #F27BBD, #874CCC, #10439F, #F27BBD);
    background-size: 300% 100%;
    animation: posterboy-background-gradient 10s linear infinite;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s ease;
}

.buy-button:hover {
    transform: scale(1.02);
}

.buy-button:active {
    transform: scale(0.98);
}

#image-error {
    text-align: center;
    padding: 40px 20px;
    color: #ccc;
}

#image-error button {
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#image-error button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Desktop Share Modal Styles */
.desktop-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.desktop-share-modal.active {
    opacity: 1;
    visibility: visible;
}

.desktop-share-content {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.desktop-share-modal.active .desktop-share-content {
    transform: scale(1);
}

.desktop-share-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.desktop-share-header h3 {
    color: white;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.desktop-share-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.desktop-share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 15px 10px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.desktop-share-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.desktop-share-option:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.2);
}

.desktop-share-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.desktop-share-option:hover .desktop-share-icon {
    transform: scale(1.05);
}

.desktop-share-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.desktop-share-label {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    color: white;
}

.desktop-share-cancel {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.desktop-share-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.desktop-share-cancel:active {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile responsiveness for individual image page */
@media (max-width: 1024px) {
    .image-page-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas: 
            "image"
            "info"
            "shop";
        gap: 20px;
        padding: 10px;
    }

    .shopping-section {
        border-left: none;
        padding-left: 0;
        justify-self: stretch;
        width: 100%;
    }

    #image-section {
        flex-direction: column;
        align-items: center;
        padding: 10px;
    }

    .image-page-grid {
        width: 100%;
    }

    .image-display {
        max-width: 100%;
        max-height: 100vh;
    }
}

@media (max-width: 768px) {
    #image-section {
        padding: 10px;
    }
    
    .shopping-section {
        padding: 15px;
    }
    
    .poster-info h3 {
        font-size: 16px;
    }
    
    .image-display {
        max-height: 50vh;
    }
    
    .image-info-section {
        width: 300px; /* Smaller default width on mobile */
    }
}

/* Portrait image specific adjustments */
@media (max-width: 1024px) and (orientation: portrait) {
    .image-display {
        max-height: 45vh;
    }
}

.go-back-btn {
    padding: 8px 16px;
    background-color: rgba(30, 30, 30, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: background-color 0.2s;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.go-back-btn:hover {
    background-color: rgba(40, 40, 40, 0.9);
}

.go-back-btn svg {
    width: 16px;
    height: 16px;
}

.frame-option {
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.frame-option.selected {
    border-color: var(--accent-color);
}

#frame-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* Full-screen image viewer styles */
.fullscreen-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow: hidden;
}

.fullscreen-container.fullscreen-fallback {
    /* Fallback for browsers without fullscreen API */
    position: fixed !important;
}

.fullscreen-image {
    max-width: 90vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    /* transition: transform 0.3s ease; */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.fullscreen-back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.fullscreen-back-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.fullscreen-back-btn svg {
    width: 16px;
    height: 16px;
}

.fullscreen-zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10001;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
    user-select: none;
}

.zoom-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-reset {
    font-size: 16px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .fullscreen-back-btn {
        top: 10px;
        left: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .fullscreen-zoom-controls {
        bottom: 10px;
        right: 10px;
        gap: 6px;
    }
    
    .zoom-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .fullscreen-image {
        max-width: 95vw;
        max-height: 95vh;
    }
}

/* Hide scrollbars in fullscreen */
.fullscreen-container::-webkit-scrollbar {
    display: none;
}

.fullscreen-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Mobile-specific full-screen styles */
.mobile-fullscreen {
    touch-action: manipulation; /* Allow natural mobile gestures */
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
}

.mobile-scroll-wrapper {
    width: 100%;
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.mobile-fullscreen-image {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    object-fit: contain;
    object-position: center top;
    touch-action: auto;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    display: block;
}

.mobile-fullscreen-image:active {
    cursor: grabbing;
}

.mobile-fullscreen-back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 20px;
    color: white;
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    backdrop-filter: blur(10px);
}

.mobile-fullscreen-back-btn:active {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(0.95);
}

.mobile-fullscreen-back-btn svg {
    width: 16px;
    height: 16px;
}

/* Additional mobile optimizations for full-screen */
@media (max-width: 768px) {
    .mobile-fullscreen-back-btn {
        top: 15px;
        left: 15px;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .mobile-scroll-wrapper {
        width: 100%;
        height: 100%;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: auto;
        display: flex;
        align-items: flex-start;
        justify-content: center;
    }
    
    .mobile-fullscreen-image {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        object-fit: contain;
        object-position: center center;
        touch-action: auto;
    }
    
    /* Ensure mobile viewport fills entire screen */
    .mobile-fullscreen {
        width: 100vw !important;
        height: 100vh !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        align-items: flex-start !important;
        justify-content: center !important;
        overflow: hidden !important;
    }
}