/* ══════════════════════════════════════════════════════════════════════════
   SETTINGS FRAMEWORK - SIMPLE TEMPLATES GALLERY
   Minimalist grid layout of visual template tiles.
   User selects a template tile -> it immediately loads the template.
   ══════════════════════════════════════════════════════════════════════════ */

.gallery-screen {
    position: fixed;
    inset: 0;
    z-index: 99990;
    width: 100vw;
    height: 100vh;
    background-color: #080a10;
    background-image: 
        radial-gradient(ellipse 60% 40% at 50% 0%, rgba(99, 102, 241, 0.18), transparent 70%),
        linear-gradient(180deg, #080a10 0%, #0d101a 100%);
    color: #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ── GALLERY STICKY TOP NAVBAR ───────────────────────────────────────────── */
.gallery-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 36px;
    background: rgba(10, 13, 22, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.gallery-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.gallery-brand-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.gallery-exit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gallery-exit-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* ── GALLERY MAIN CONTAINER ──────────────────────────────────────────────── */
.gallery-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 28px 80px 28px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ── HEADER ──────────────────────────────────────────────────────────────── */
.gallery-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gallery-title {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin: 0;
}

.gallery-subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

/* ── TEMPLATES GRID ──────────────────────────────────────────────────────── */
.templates-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 360px));
    gap: 24px;
}

/* ── TEMPLATE TILE CARD ──────────────────────────────────────────────────── */
.template-tile {
    background: rgba(18, 22, 34, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.template-tile:hover {
    transform: translateY(-4px);
    border-color: #6366f1;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 24px rgba(99, 102, 241, 0.25);
}

/* Thumbnail Visual Representation */
.tile-thumbnail {
    height: 170px;
    background: #090c14;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.tile-thumbnail-mock {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #111522;
    display: flex;
    overflow: hidden;
}

.mock-sidepanel {
    width: 32%;
    background: #151a2a;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mock-sidepanel-title {
    width: 50%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    margin-bottom: 4px;
}

.mock-tab {
    height: 10px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.05);
}

.mock-tab.active {
    background: rgba(99, 102, 241, 0.35);
    border-left: 2px solid #818cf8;
}

.mock-content {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #0b0e18;
}

.mock-header-line {
    width: 60%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 2px;
}

.mock-box {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mock-field {
    width: 80%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.mock-input {
    width: 100%;
    height: 14px;
    background: #151a2a;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Hover overlay prompt on thumbnail */
.tile-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.template-tile:hover .tile-hover-overlay {
    opacity: 1;
}

.tile-hover-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #6366f1;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
}

/* Tile Information Body */
.tile-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.tile-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tile-id-badge {
    font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 11px;
    font-weight: 800;
    color: #818cf8;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.04em;
}

.tile-status-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    padding: 2px 7px;
    border-radius: 4px;
}

.tile-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
}

.tile-meta {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

/* Tile Action Footer */
.tile-footer {
    padding: 12px 20px 16px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tile-load-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: 1px solid #818cf8;
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tile-load-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

.tile-action-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tile-action-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}
