/* ============================================================
   AI Render — Main CSS
   Dark Gold Theme · UTF-8 · No Bootstrap
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── CSS Variables ──────────────────────────────────────────── */
:root {
    /* Backgrounds */
    --bg-primary:     #0D0D15;
    --bg-secondary:   #1A1A2E;
    --bg-tertiary:    #13131F;
    --bg-card:        rgba(26, 26, 46, 0.85);
    --bg-glass:       rgba(26, 26, 50, 0.7);
    --bg-hover:       rgba(255, 255, 255, 0.05);
    --bg-active:      rgba(212, 168, 83, 0.12);

    /* Gold palette */
    --gold-primary:   #D4A853;
    --gold-light:     #F0C674;
    --gold-dark:      #B8942D;
    --gold-subtle:    #A07838;
    --gold-glow:      rgba(212, 168, 83, 0.2);
    --gold-glow-lg:   rgba(212, 168, 83, 0.35);

    /* Text */
    --text-primary:   #EAEAEA;
    --text-secondary: #A0A0B0;
    --text-muted:     #606070;
    --text-gold:      #D4A853;
    --text-inverse:   #0D0D15;

    /* Status */
    --color-success:  #2ECC71;
    --color-error:    #E74C3C;
    --color-warning:  #F39C12;
    --color-info:     #3498DB;

    /* Borders */
    --border-glass:   1px solid rgba(212, 168, 83, 0.18);
    --border-subtle:  1px solid rgba(255, 255, 255, 0.06);
    --border-focus:   1px solid var(--gold-primary);

    /* Shadows */
    --shadow-sm:      0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md:      0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg:      0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-gold:    0 0 20px var(--gold-glow);
    --shadow-gold-lg: 0 0 40px var(--gold-glow-lg);

    /* Layout */
    --sidebar-width:  280px;
    --header-height:  60px;
    --radius-sm:      6px;
    --radius-md:      10px;
    --radius-lg:      16px;
    --radius-xl:      24px;

    /* Typography */
    --font:           'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-mono:      'JetBrains Mono', 'Fira Code', monospace;

    /* Transitions */
    --transition:     0.2s ease;
    --transition-slow:0.35s ease;
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

p { color: var(--text-secondary); }

a {
    color: var(--gold-primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--gold-light); }

ul, ol { list-style: none; }

img, video { max-width: 100%; height: auto; }

/* ─── Layout ─────────────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-area {
    flex: 1;
    padding: 1.5rem;
    padding-top: calc(var(--header-height) + 1.5rem);
}

/* ─── Header ─────────────────────────────────────────────────── */
.app-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: rgba(13, 13, 21, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 50;
}

.header-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.credit-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.875rem;
    background: rgba(212, 168, 83, 0.1);
    border: var(--border-glass);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold-light);
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: var(--border-glass);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 60;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 1.25rem 1.5rem;
    border-bottom: var(--border-glass);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.sidebar-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.75rem 1.5rem 0.4rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 450;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sidebar-item.active {
    color: var(--gold-primary);
    background: var(--bg-active);
    border-left-color: var(--gold-primary);
    font-weight: 500;
}

.sidebar-item-icon { font-size: 1rem; opacity: 0.9; min-width: 18px; }

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: var(--border-glass);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition);
}
.user-info:hover { background: var(--bg-hover); }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-inverse);
    flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }
.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.7rem 0.875rem;
    background: rgba(255, 255, 255, 0.05);
    border: var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23D4A853' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-textarea.tall { min-height: 120px; }

.field-error {
    font-size: 0.75rem;
    color: var(--color-error);
    margin-top: 0.3rem;
    display: none;
}
.field-error.show { display: block; }

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: var(--text-inverse);
    font-weight: 600;
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(212, 168, 83, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.07);
    border: var(--border-subtle);
    color: var(--text-primary);
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.btn-ghost {
    background: transparent;
    border: var(--border-glass);
    color: var(--gold-primary);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--bg-active);
}

.btn-danger {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #ff6b6b;
}
.btn-danger:hover:not(:disabled) {
    background: rgba(231, 76, 60, 0.25);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-full { width: 100%; }

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #5dde8b;
}

.alert-error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #ff6b6b;
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid rgba(243, 156, 18, 0.3);
    color: #f5b942;
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: #5babde;
}

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-gold    { background: rgba(212,168,83,0.15); color: var(--gold-light); border: 1px solid rgba(212,168,83,0.3); }
.badge-success { background: rgba(46,204,113,0.15); color: #5dde8b; border: 1px solid rgba(46,204,113,0.3); }
.badge-error   { background: rgba(231,76,60,0.15);  color: #ff6b6b; border: 1px solid rgba(231,76,60,0.3); }
.badge-warning { background: rgba(243,156,18,0.15); color: #f5b942; border: 1px solid rgba(243,156,18,0.3); }
.badge-muted   { background: rgba(255,255,255,0.07); color: var(--text-secondary); border: var(--border-subtle); }

/* ─── Tables ─────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: var(--border-glass);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead tr {
    background: rgba(212, 168, 83, 0.05);
    border-bottom: var(--border-glass);
}

thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

tbody tr {
    border-bottom: var(--border-subtle);
    transition: background var(--transition);
}

tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child { border-bottom: none; }

tbody td {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    vertical-align: middle;
}

/* ─── Progress ───────────────────────────────────────────────── */
.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
    border-radius: 100px;
    transition: width var(--transition-slow);
}

/* ─── Loading spinner ────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(212, 168, 83, 0.3);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ─── Image Gallery ──────────────────────────────────────────── */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.image-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: var(--border-subtle);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    background: var(--bg-tertiary);
    position: relative;
}

.image-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold);
    border-color: rgba(212, 168, 83, 0.4);
}

.image-card img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-slow);
}

.image-card:hover img { transform: scale(1.03); }

.image-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity var(--transition);
}
.image-card:hover .image-card-overlay { opacity: 1; }

/* ─── Generating placeholder ─────────────────────────────────── */
.image-generating {
    aspect-ratio: 16/10;
    background: linear-gradient(45deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 200%;
    animation: shimmer 1.5s ease infinite;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.75rem;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Tags ───────────────────────────────────────────────────── */
.tag-group-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: var(--border-subtle);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.tag-chip:hover {
    border-color: rgba(212, 168, 83, 0.4);
    color: var(--gold-light);
    background: rgba(212, 168, 83, 0.08);
}

.tag-chip.selected {
    background: rgba(212, 168, 83, 0.15);
    border-color: var(--gold-primary);
    color: var(--gold-light);
    font-weight: 500;
}

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-secondary);
    border: var(--border-glass);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform var(--transition);
    box-shadow: var(--shadow-lg);
}

.modal-backdrop.show .modal { transform: scale(1); }

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title { font-size: 1rem; font-weight: 600; }

.modal-close {
    width: 28px; height: 28px;
    border: none;
    background: var(--bg-hover);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition);
}
.modal-close:hover { background: rgba(231,76,60,0.2); color: #ff6b6b; }

.modal-body { padding: 1.5rem; }
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: var(--border-glass);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ─── Divider ────────────────────────────────────────────────── */
.divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 1rem 0;
}

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(212, 168, 83, 0.3);
    border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(212, 168, 83, 0.5); }

/* ─── Utilities ──────────────────────────────────────────────── */
.text-gold     { color: var(--gold-primary); }
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-success  { color: var(--color-success); }
.text-error    { color: var(--color-error); }
.text-sm       { font-size: 0.8rem; }
.text-xs       { font-size: 0.72rem; }
.font-bold     { font-weight: 700; }
.font-medium   { font-weight: 500; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1         { gap: 0.5rem; }
.gap-2         { gap: 1rem; }
.mt-1          { margin-top: 0.5rem; }
.mt-2          { margin-top: 1rem; }
.mb-1          { margin-bottom: 0.5rem; }
.mb-2          { margin-bottom: 1rem; }
.w-full        { width: 100%; }
.hidden        { display: none !important; }

/* ─── App Grid ────────────────────────────────────────────────── */
.app-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .app-grid { grid-template-columns: 1fr; }
}

/* ─── Tag Accordion (<details>) ──────────────────────────────── */
.tag-accordion {
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: background var(--transition), border-color var(--transition);
}

.tag-accordion[open] {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(212, 168, 83, 0.2);
}

.tag-accordion summary {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag-accordion summary::-webkit-details-marker { display: none; }

.tag-accordion summary::after {
    content: '▼';
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.tag-accordion[open] summary::after {
    transform: rotate(180deg);
    color: var(--gold-primary);
}

.tag-accordion .tag-grid {
    padding: 0 1rem 1rem 1rem;
    margin-bottom: 0;
}

/* ─── Form Range (Slider) ────────────────────────────────────── */
.form-range {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    outline: none;
    margin: 10px 0;
}
.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold-primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(212, 168, 83, 0.4);
    transition: transform var(--transition);
}
.form-range::-webkit-slider-thumb:hover { transform: scale(1.2); }


/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
    :root { --sidebar-width: 0px; }
    .sidebar { transform: translateX(-280px); transition: transform var(--transition-slow); }
    .sidebar.open { transform: translateX(0); width: 280px; }
    .main-content { margin-left: 0; }
    .app-header { left: 0; }
}

@media (max-width: 640px) {
    .content-area { padding: 1rem; padding-top: calc(var(--header-height) + 1rem); }
    .image-grid   { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .local-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ─── Local Gallery (IndexedDB) ─────────────────────────────── */
.local-gallery {
    margin-top: 1.5rem;
}

.local-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.local-gallery-card {
    background: var(--bg-tertiary);
    border: var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    position: relative;
}

.local-gallery-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold);
    border-color: rgba(212, 168, 83, 0.4);
}

.local-gallery-card-img {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg-secondary);
}

.local-gallery-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-slow);
}

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

.local-gallery-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    opacity: 0.3;
}

.local-gallery-card-info {
    padding: 0.6rem 0.75rem 0.4rem;
}

.local-gallery-card-prompt {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.local-gallery-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.local-gallery-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.3rem;
    padding: 0 0.6rem 0.6rem;
    opacity: 0;
    transition: opacity var(--transition);
}

.local-gallery-card:hover .local-gallery-card-actions {
    opacity: 1;
}
