/* ==========================================================================
   TopWallpaperSite - AI Photo Prompts Design System (Senior Level UI)
   Comprehensive, clean, modular CSS with explicit grid/flex rules.
   ========================================================================== */

:root {
    --twp-teal: #0d9488;
    --twp-teal-hover: #0f766e;
    --twp-teal-light: #f0fdfa;
    --twp-teal-border: #ccfbf1;
    --twp-cyan: #0891b2;
    --twp-dark: #0f172a;
    --twp-dark-border: #1e293b;
    --twp-dark-surface: #1e293b;
    --twp-text-dark: #111827;
    --twp-text-muted: #6b7280;
    --twp-border: #f3f4f6;
    --twp-border-card: #e5e7eb;
    --twp-radius-sm: 6px;
    --twp-radius-md: 10px;
    --twp-radius-lg: 14px;
    --twp-radius-pill: 999px;
    --twp-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --twp-shadow-md: 0 4px 15px rgba(0, 0, 0, 0.06);
    --twp-shadow-btn: 0 3px 12px rgba(13, 148, 136, 0.28);
    --twp-shadow-btn-hover: 0 5px 18px rgba(13, 148, 136, 0.38);
}

/* ==========================================================================
   1. GALLERY / INDEX PAGE STYLES
   ========================================================================== */

.ai-hero-section {
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 30%, #eff6ff 70%, #f0f9ff 100%);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #f3f4f6;
    padding: 3.5rem 1rem;
    text-align: center;
}

.ai-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(13, 148, 136, 0.1);
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: var(--twp-radius-pill);
    color: var(--twp-teal);
    font-size: 12px;
    font-weight: 500;
}

.ai-feature-tag {
    padding: 5px 14px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: var(--twp-radius-pill);
    font-size: 12px;
    color: #4b5563;
    font-weight: 500;
    box-shadow: var(--twp-shadow-sm);
    border: 1px solid #f3f4f6;
}

.ai-category-nav {
    background: #ffffff;
    border-bottom: 1px solid #f3f4f6;
    position: sticky;
    top: 64px;
    z-index: 30;
}

.ai-category-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 8px 0;
}
.ai-category-bar::-webkit-scrollbar {
    display: none;
}

.ai-category-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: var(--twp-radius-pill);
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    color: #4b5563;
}
.ai-category-btn:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #111827;
}
.ai-category-btn.active {
    background: var(--twp-teal);
    color: #ffffff;
    box-shadow: var(--twp-shadow-btn);
    border-color: transparent;
}
.ai-category-btn.active .cat-count {
    opacity: 0.85;
}
.ai-category-btn .cat-count {
    font-size: 11px;
    opacity: 0.6;
}

.ai-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 16px;
}
@media (min-width: 640px) {
    .ai-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}
@media (min-width: 1024px) {
    .ai-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
}
@media (min-width: 1280px) {
    .ai-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 20px;
    }
}

.ai-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: var(--twp-radius-lg);
    border: 1px solid #f3f4f6;
    box-shadow: var(--twp-shadow-sm);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    text-decoration: none;
    color: inherit;
}
.ai-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    border-color: #e5e7eb;
}

.ai-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #f3f4f6;
    overflow: hidden;
    display: block;
}
.ai-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.35s cubic-bezier(.25,.46,.45,.94);
}
.ai-card:hover .ai-card-media img {
    transform: scale(1.03);
}

.ai-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: var(--twp-radius-pill);
    background: rgba(17, 24, 39, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    z-index: 2;
}

.ai-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.ai-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--twp-text-dark);
    margin: 0 0 4px 0;
    line-height: 1.35;
    transition: color 0.2s ease;
}
.ai-card-title:hover {
    color: var(--twp-teal);
}
.ai-card-desc {
    font-size: 12px;
    color: var(--twp-text-muted);
    line-height: 1.45;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-card-prompt-preview {
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 11px;
    color: #4b5563;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.ai-card-actions {
    margin-top: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.ai-btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: var(--twp-teal-light);
    border: 1px solid var(--twp-teal-border);
    color: var(--twp-teal);
    cursor: pointer;
    transition: all 0.2s ease;
}
.ai-btn-copy:hover {
    background: var(--twp-teal);
    border-color: var(--twp-teal);
    color: #ffffff;
}

.ai-btn-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
}
.ai-btn-view:hover {
    background: #111827;
    border-color: #111827;
    color: #ffffff;
}

.ai-guide-banner {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 1px solid #f3f4f6;
    border-radius: var(--twp-radius-lg);
    box-shadow: var(--twp-shadow-sm);
    padding: 2rem 1.5rem;
    margin-top: 3rem;
}

.ai-guide-step-card {
    background: #ffffff;
    padding: 18px 16px;
    border-radius: var(--twp-radius-md);
    border: 1px solid #f3f4f6;
    box-shadow: var(--twp-shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.ai-guide-step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--twp-teal-light);
    color: var(--twp-teal);
    border: 1px solid var(--twp-teal-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 10px;
}

.ai-search-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    padding: 14px;
}
.ai-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}
.ai-search-field {
    position: relative;
    min-width: 0;
}
.ai-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    color: #94a3b8;
    pointer-events: none;
    transform: translateY(-50%);
}
.ai-search-input {
    width: 100%;
    min-width: 0;
    height: 44px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
    color: #111827;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    padding: 0 14px 0 42px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.ai-search-input::placeholder {
    color: #94a3b8;
}
.ai-search-input:focus {
    border-color: var(--twp-teal);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
}
.ai-search-button {
    height: 44px;
    border: 1px solid var(--twp-teal);
    border-radius: 10px;
    background: linear-gradient(135deg, #0d9488, #0891b2);
    box-shadow: var(--twp-shadow-btn);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13.5px;
    font-weight: 700;
    padding: 0 20px;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.ai-search-button:hover {
    border-color: var(--twp-teal-hover);
    box-shadow: var(--twp-shadow-btn-hover);
    transform: translateY(-1px);
}
.ai-search-button:active {
    transform: translateY(0);
}
.ai-search-button-icon {
    width: 15px;
    height: 15px;
}
.ai-search-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 11px;
    color: #6b7280;
    font-size: 13px;
}
.ai-search-status a {
    border-radius: var(--twp-radius-pill);
    background: var(--twp-teal-light);
    border: 1px solid var(--twp-teal-border);
    color: var(--twp-teal);
    font-weight: 600;
    padding: 4px 10px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ai-search-status a:hover {
    background: var(--twp-teal);
    border-color: var(--twp-teal);
    color: #ffffff;
}
.ai-empty-state {
    background: #ffffff;
    border: 1px dashed #d1d5db;
    border-radius: var(--twp-radius-md);
    padding: 28px 18px;
    text-align: center;
}
.ai-empty-state h3 {
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px 0;
}
.ai-empty-state p {
    color: #6b7280;
    font-size: 14px;
    margin: 0 0 14px 0;
}
.ai-empty-state a {
    color: var(--twp-teal);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.ai-empty-state a:hover {
    color: var(--twp-teal-hover);
}
@media (max-width: 420px) {
    .ai-search-form {
        grid-template-columns: 1fr;
    }
    .ai-search-button {
        width: 100%;
    }
    .ai-search-status {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* ==========================================================================
   2. DETAIL PAGE STYLES (EXPLICIT 2-COLUMN DESKTOP GRID)
   ========================================================================== */

.ai-detail-page {
    padding: 1.5rem 0 3rem 0;
}

.ai-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}
@media (min-width: 640px) {
    .ai-detail-container {
        padding: 0 1.5rem;
    }
}
@media (min-width: 1024px) {
    .ai-detail-container {
        padding: 0 2rem;
    }
}

/* ── Breadcrumb ── */
.ai-breadcrumb-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 1.25rem;
}
.ai-breadcrumb-nav a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s ease;
}
.ai-breadcrumb-nav a:hover {
    color: var(--twp-teal);
}
.ai-breadcrumb-sep {
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
}

/* ── Main Two-Column Layout on Desktop ── */
.ai-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .ai-detail-grid {
        grid-template-columns: 340px 1fr;
        gap: 2rem;
    }
}

@media (min-width: 1200px) {
    .ai-detail-grid {
        grid-template-columns: 360px 1fr;
        gap: 2.25rem;
    }
}

/* ── Left Column: Media & Specs ── */
.ai-detail-col-media {
    width: 100%;
}
@media (min-width: 1024px) {
    .ai-detail-col-media-sticky {
        position: sticky;
        top: 80px;
    }
}

.ai-detail-image-box {
    position: relative;
    border-radius: var(--twp-radius-lg);
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid #f3f4f6;
    box-shadow: var(--twp-shadow-sm);
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}
.ai-detail-image-box img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: top center;
}

/* ── Template Specs Card ── */
.ai-detail-specs-card {
    background: #ffffff;
    border-radius: var(--twp-radius-md);
    border: 1px solid #f3f4f6;
    box-shadow: var(--twp-shadow-sm);
    padding: 12px 14px;
    margin-top: 12px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}
.ai-specs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.ai-specs-header span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--twp-text-dark);
}
.ai-specs-header a {
    font-size: 11px;
    font-weight: 600;
    color: var(--twp-teal);
}
.ai-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.ai-spec-item {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: var(--twp-radius-sm);
    padding: 6px 10px;
}
.ai-spec-label {
    display: block;
    font-size: 10px;
    color: #9ca3af;
    margin-bottom: 2px;
}
.ai-spec-val {
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
}
.ai-spec-val.accent {
    color: var(--twp-teal);
}

/* ── Right Column: Info, Prompt Box & Actions ── */
.ai-detail-col-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.ai-category-tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--twp-teal-light);
    border: 1px solid var(--twp-teal-border);
    border-radius: var(--twp-radius-pill);
    color: var(--twp-teal);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    width: fit-content;
}

.ai-detail-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--twp-text-dark);
    margin: 4px 0 4px 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
@media (min-width: 640px) {
    .ai-detail-title {
        font-size: 26px;
    }
}

.ai-detail-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

/* ── Dark Prompt Container ── */
.ai-prompt-box {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: var(--twp-radius-md);
    padding: 14px 16px;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.16);
}
.ai-prompt-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #273549;
}
.ai-prompt-box-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-family: monospace;
    color: #94a3b8;
}
.ai-prompt-box-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2dd4bf;
}
.ai-btn-copy-header {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #1e293b;
    border: 1px solid #475569;
    color: #38bdf8;
    border-radius: var(--twp-radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ai-btn-copy-header:hover {
    background: var(--twp-teal);
    border-color: var(--twp-teal);
    color: #ffffff;
}

.ai-prompt-box-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.6;
    color: #f1f5f9;
    white-space: pre-wrap;
    word-break: break-word;
    user-select: all;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}
.ai-prompt-box-text::-webkit-scrollbar {
    width: 4px;
}
.ai-prompt-box-text::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

/* ── Primary Big Copy Button ── */
.ai-btn-copy-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 20px;
    background: linear-gradient(135deg, #0d9488, #0891b2);
    color: #ffffff;
    border: none;
    border-radius: var(--twp-radius-md);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--twp-shadow-btn);
}
.ai-btn-copy-main:hover {
    transform: translateY(-1px);
    box-shadow: var(--twp-shadow-btn-hover);
}
.ai-btn-copy-main:active {
    transform: translateY(0);
}

/* ── Compatible AI Tools Bar ── */
.ai-tools-card {
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: var(--twp-radius-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: var(--twp-shadow-sm);
}
.ai-tools-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}
.ai-tools-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.ai-tool-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--twp-radius-sm);
    background: #f3f4f6;
    color: #374151;
    font-size: 11px;
    font-weight: 500;
}
.ai-tool-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--twp-teal);
}

/* ── Step-by-Step Mini Guide (Compact Grid) ── */
.ai-guide-card {
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: var(--twp-radius-md);
    padding: 12px 14px;
    box-shadow: var(--twp-shadow-sm);
}
.ai-guide-card-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--twp-text-dark);
    margin-bottom: 8px;
}
.ai-step-compact-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 6px;
}
@media (min-width: 640px) {
    .ai-step-compact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.ai-step-compact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: var(--twp-radius-sm);
}
.ai-step-compact-num {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--twp-teal-light);
    color: var(--twp-teal);
    border: 1px solid var(--twp-teal-border);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ai-step-compact-label {
    font-size: 11px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.2;
}
.ai-step-compact-sub {
    font-size: 10px;
    color: #6b7280;
    line-height: 1.2;
}

.ai-tool-pill.active-gemini {
    background: linear-gradient(135deg, #eff6ff, #f0fdfa);
    border: 1px solid #99f6e4;
    color: #0f766e;
    font-weight: 600;
}
.ai-tool-pill.active-gemini .ai-tool-dot {
    background: #0d9488;
    box-shadow: 0 0 6px rgba(13, 148, 136, 0.6);
}

/* ── Expected Result Card (Left Column) ── */
.ai-expected-card {
    background: #ffffff;
    border-radius: var(--twp-radius-md);
    border: 1px solid #ccfbf1;
    box-shadow: 0 1px 3px rgba(13, 148, 136, 0.08);
    padding: 12px 14px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}
.ai-expected-header {
    display: flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0f766e;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0fdfa;
}
.ai-expected-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ai-expected-list li {
    font-size: 11px;
    line-height: 1.4;
    color: #374151;
}
.ai-expected-list li strong {
    color: #111827;
    font-weight: 600;
}
.ai-expected-list li span {
    color: #4b5563;
}

/* ── Best Photo Upload Guidance ── */
.ai-upload-guidance-card {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-left: 3px solid #f59e0b;
    border-radius: var(--twp-radius-sm);
    padding: 10px 12px;
}
.ai-upload-guidance-header {
    display: flex;
    align-items: center;
}

/* ── Customization Chips ── */
.ai-custom-groups {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.ai-custom-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.ai-custom-group-label {
    font-size: 11px;
    font-weight: 600;
    color: #4b5563;
    min-width: 90px;
}
.ai-custom-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.ai-custom-chip {
    display: inline-block;
    padding: 2px 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: var(--twp-radius-pill);
    font-size: 11px;
    color: #334155;
    font-weight: 500;
}

/* ── FAQ Section on Detail Page ── */
.ai-faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}
.ai-faq-item {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
}
.ai-faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.ai-faq-q {
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 3px 0;
    line-height: 1.35;
}
.ai-faq-a {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

/* ── Related Tags ── */
.ai-tags-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}
.ai-tags-label {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    margin-right: 2px;
}
.ai-tag-pill {
    display: inline-block;
    padding: 3px 10px;
    background: var(--twp-teal-light);
    border: 1px solid var(--twp-teal-border);
    border-radius: var(--twp-radius-pill);
    color: var(--twp-teal);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}
.ai-tag-pill:hover {
    background: var(--twp-teal);
    border-color: var(--twp-teal);
    color: #ffffff;
}


/* ==========================================================================
   3. "MORE AI PHOTO PROMPTS" COMPACT 3-COLUMN / 4-COLUMN GRID
   ========================================================================== */

.ai-related-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.ai-related-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.ai-related-heading {
    font-size: 16px;
    font-weight: 700;
    color: var(--twp-text-dark);
    margin: 0;
}
.ai-related-sub {
    font-size: 12px;
    color: #6b7280;
    margin: 2px 0 0 0;
}
.ai-related-link-all {
    font-size: 12px;
    font-weight: 600;
    color: var(--twp-teal);
    text-decoration: none;
    transition: color 0.15s ease;
}
.ai-related-link-all:hover {
    color: var(--twp-teal-hover);
}

.ai-related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
@media (min-width: 600px) {
    .ai-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}
@media (min-width: 960px) {
    .ai-related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

.ai-related-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: var(--twp-radius-md);
    border: 1px solid #f3f4f6;
    box-shadow: var(--twp-shadow-sm);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.ai-related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.07);
    border-color: #e5e7eb;
}

.ai-related-media {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #f3f4f6;
    overflow: hidden;
    display: block;
}
.ai-related-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.35s ease;
}
.ai-related-card:hover .ai-related-media img {
    transform: scale(1.04);
}

.ai-related-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: var(--twp-radius-pill);
    background: rgba(17, 24, 39, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    z-index: 2;
}

.ai-related-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ai-related-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--twp-text-dark);
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s ease;
    text-decoration: none;
}
.ai-related-title:hover {
    color: var(--twp-teal);
}

.ai-related-desc {
    font-size: 11px;
    color: var(--twp-text-muted);
    line-height: 1.35;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-related-actions {
    margin-top: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
}

.ai-related-btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: var(--twp-teal-light);
    border: 1px solid var(--twp-teal-border);
    color: var(--twp-teal);
    cursor: pointer;
    transition: all 0.15s ease;
}
.ai-related-btn-copy:hover {
    background: var(--twp-teal);
    border-color: var(--twp-teal);
    color: #ffffff;
}

.ai-related-btn-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #374151;
    text-decoration: none;
    transition: all 0.15s ease;
}
.ai-related-btn-view:hover {
    background: #111827;
    border-color: #111827;
    color: #ffffff;
}


/* ==========================================================================
   4. TOAST NOTIFICATION & MOBILE ADJUSTMENTS
   ========================================================================== */

.ai-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #111827;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: var(--twp-radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 500;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.ai-toast.show {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 640px) {
    .ai-toast {
        left: 14px;
        right: 14px;
        bottom: 14px;
        justify-content: center;
    }
}
