/**
 * AI Print Generator — dark theme matching City Memory Challenge.
 */

/* ─── Hide page title ──────────────────────────────────────────────────────── */
body.sw-ai-print-generator-page .entry-title,
body.sw-ai-print-generator-page h1.entry-title,
body.sw-ai-print-generator-page .et_pb_title_container,
body.sw-ai-print-generator-page .et_post_meta_wrapper h1,
body.sw-ai-print-generator-page #main-content h1.entry-title {
    display: none !important;
}

/* ─── Full-width breakout ──────────────────────────────────────────────────── */
.sw-ai-print-generator {
    width: 100vw;
    max-width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ─── Steps ────────────────────────────────────────────────────────────────── */
.sw-ai-step { display: none; }
.sw-ai-step.active { display: block; }

/* ══════════════════════════════════════════════════════════════════════════════
   STEP 1 — CITY SELECTOR  (all dark)
══════════════════════════════════════════════════════════════════════════════ */
.sw-ai-step-city {
    background: linear-gradient(135deg, #0a0a0a 0%, #141414 50%, #1e1e1e 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

/* subtle grid overlay — same as memory game */
.sw-ai-step-city::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

/* ── Hero section ── */
.sw-ai-hero {
    padding: clamp(3rem, 7vw, 5rem) 24px 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.sw-ai-hero-inner {
    max-width: 680px;
    margin: 0 auto;
}

.sw-ai-hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.15em;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.sw-ai-step-city .sw-ai-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 16px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.sw-ai-step-city .sw-ai-description {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.55);
    margin: 0 auto;
    line-height: 1.65;
    max-width: 560px;
}

/* ── City selector wrap ── */
.sw-ai-city-selector-wrap {
    padding: 0 24px clamp(3rem, 7vw, 5rem);
    position: relative;
    z-index: 1;
}

.sw-ai-city-selector {
    max-width: 680px;
    margin: 0 auto;
}

/* Featured label */
.sw-ai-featured-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin: 0 0 14px;
    text-align: center;
}

/* City tiles */
.sw-ai-city-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 28px;
}

.sw-ai-city-tile {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-family: inherit;
}

.sw-ai-city-tile:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

.sw-ai-city-tile.active {
    background: #fff;
    border-color: #fff;
    color: #0a0a0a;
    font-weight: 600;
}

/* Divider */
.sw-ai-city-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 20px;
    color: rgba(255,255,255,0.28);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sw-ai-city-divider::before,
.sw-ai-city-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

/* City input */
.sw-ai-city-input-wrap {
    position: relative;
    margin-bottom: 20px;
}

.sw-ai-city-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.35);
    pointer-events: none;
}

.sw-ai-city-input {
    width: 100%;
    background: rgba(255,255,255,0.07) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    color: #fff !important;
    font-size: 15px;
    padding: 13px 18px 13px 56px !important;
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
    -webkit-appearance: none;
    box-shadow: none !important;
}

.sw-ai-city-input::placeholder { color: rgba(255,255,255,0.28) !important; }

.sw-ai-city-input:focus {
    border-color: rgba(255,255,255,0.45) !important;
    background: rgba(255,255,255,0.1) !important;
}

/* Custom city autocomplete dropdown */
.sw-ai-city-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #1e1e1e;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    overflow: hidden;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.sw-ai-dropdown-item {
    padding: 10px 16px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.1s;
}

.sw-ai-dropdown-item:hover,
.sw-ai-dropdown-active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* Selected city display */
.sw-ai-selected-city {
    display: none;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    align-items: center;
    gap: 10px;
}

.sw-ai-selected-city span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    flex-shrink: 0;
}

.sw-ai-selected-city strong {
    color: #fff;
    font-size: 15px;
    flex: 1;
}

.sw-ai-clear-city {
    background: none;
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.45);
    font-size: 16px;
    line-height: 1;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.sw-ai-clear-city:hover {
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

/* ── Buttons (global) ── */
.sw-ai-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-family: inherit;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s, opacity 0.15s;
}

.sw-ai-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
}

/* On dark bg — primary is white */
.sw-ai-step-city .sw-ai-button-primary {
    background: #fff;
    color: #0a0a0a;
    font-size: 15px;
    padding: 16px 36px;
    width: 100%;
}

.sw-ai-step-city .sw-ai-button-primary:hover:not(:disabled) {
    background: #e8e8e8;
    transform: translateY(-1px);
}

/* Spinner inside button */
.sw-ai-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: sw-spin 0.7s linear infinite;
    vertical-align: middle;
}

.sw-ai-step-city .sw-ai-spinner {
    border-color: rgba(0,0,0,0.2);
    border-top-color: #0a0a0a;
}

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

/* ── Timer bar ── */
.sw-ai-gen-timer {
    display: none;
    margin-top: 20px;
}

.sw-ai-gen-bar {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    height: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.sw-ai-gen-progress {
    height: 100%;
    background: rgba(255,255,255,0.7);
    border-radius: 4px;
    width: 100%;
    transition: width 1s linear;
}

.sw-ai-gen-label {
    font-size: 12px;
    color: rgba(255,255,255,0.38);
    text-align: center;
}

/* ── Style note ── */
.sw-ai-style-note {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 7px;
    font-size: 12px;
    color: rgba(255,255,255,0.28);
    margin-top: 20px;
    line-height: 1.5;
    text-align: center;
}

.sw-ai-style-note svg {
    flex-shrink: 0;
    margin-top: 1px;
    opacity: 0.5;
}

/* ══════════════════════════════════════════════════════════════════════════════
   STEP 2 — PREVIEW  (dark — matching memory game game screen)
══════════════════════════════════════════════════════════════════════════════ */
.sw-ai-step-preview {
    background: linear-gradient(180deg, #141414 0%, #1a1a1a 100%);
    color: #fff;
    padding: clamp(2.5rem, 6vw, 4rem) 24px;
}

.sw-ai-step-preview .sw-ai-header {
    text-align: center;
    margin-bottom: 36px;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.sw-ai-step-preview .sw-ai-title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
    letter-spacing: -0.01em;
}

.sw-ai-step-preview .sw-ai-description {
    color: rgba(255,255,255,0.5);
    font-size: 1rem;
    line-height: 1.6;
}

/* Artwork preview */
.sw-ai-artwork-preview {
    max-width: 800px;
    margin: 0 auto 36px;
}

.sw-ai-preview-container {
    background: #222;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.6);
}

.sw-ai-preview-container img {
    max-width: 100%;
    height: auto;
    display: block;
}

.sw-ai-preview-watermark-notice {
    padding: 12px 18px;
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    text-align: center;
    font-style: italic;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* Size selection */
.sw-ai-size-selection {
    max-width: 680px;
    margin: 0 auto 32px;
}

.sw-ai-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.35);
    margin: 0 0 16px;
    text-align: center;
}

.sw-ai-size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.sw-ai-size-option input[type="radio"] { display: none; }

.sw-ai-size-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 22px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    min-width: 110px;
    transition: border-color 0.15s, background 0.15s;
}

.sw-ai-size-option input:checked + .sw-ai-size-card {
    border-color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.1);
}

.sw-ai-size-option:hover .sw-ai-size-card {
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.07);
}

.sw-ai-size-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 3px;
}

.sw-ai-size-dimensions {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 6px;
}

.sw-ai-size-price {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

/* Step 2 actions */
.sw-ai-step-preview .sw-ai-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 680px;
    margin: 0 auto;
}

/* Primary on dark: white button */
.sw-ai-step-preview .sw-ai-button-primary {
    background: #fff;
    color: #0a0a0a;
}

.sw-ai-step-preview .sw-ai-button-primary:hover:not(:disabled) {
    background: #e8e8e8;
    transform: translateY(-1px);
}

.sw-ai-step-preview .sw-ai-spinner {
    border-color: rgba(0,0,0,0.2);
    border-top-color: #0a0a0a;
}

/* Secondary: ghost */
.sw-ai-step-preview .sw-ai-button-secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.65);
}

.sw-ai-step-preview .sw-ai-button-secondary:hover {
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

/* ══════════════════════════════════════════════════════════════════════════════
   STEP 3 — SUCCESS  (dark — same as memory game results)
══════════════════════════════════════════════════════════════════════════════ */
.sw-ai-step-success {
    background: linear-gradient(135deg, #0a0a0a 0%, #141414 50%, #1e1e1e 100%);
    color: #fff;
    padding: clamp(4rem, 10vw, 6rem) 24px;
    position: relative;
    overflow: hidden;
}

.sw-ai-step-success::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

.sw-ai-success-content {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.sw-ai-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    color: #fff;
}

.sw-ai-step-success .sw-ai-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 14px;
    letter-spacing: -0.02em;
}

.sw-ai-step-success .sw-ai-description {
    color: rgba(255,255,255,0.5);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 36px;
}

.sw-ai-success-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.sw-ai-step-success .sw-ai-button-primary {
    background: #fff;
    color: #0a0a0a;
}

.sw-ai-step-success .sw-ai-button-primary:hover:not(:disabled) {
    background: #e8e8e8;
    transform: translateY(-1px);
}

.sw-ai-step-success .sw-ai-button-secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.65);
}

.sw-ai-step-success .sw-ai-button-secondary:hover {
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

/* ══════════════════════════════════════════════════════════════════════════════
   LOADING OVERLAY
══════════════════════════════════════════════════════════════════════════════ */
.sw-ai-loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,10,10,0.88);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.sw-ai-loading-content {
    text-align: center;
    padding: 48px;
    max-width: 380px;
}

.sw-ai-loading-spinner {
    width: 52px;
    height: 52px;
    border: 3px solid rgba(255,255,255,0.12);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sw-spin 0.8s linear infinite;
    margin: 0 auto 24px;
}

.sw-ai-loading-text {
    color: rgba(255,255,255,0.85);
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
    letter-spacing: 0.03em;
}

.sw-ai-loading-subtext {
    color: rgba(255,255,255,0.4);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* ══════════════════════════════════════════════════════════════════════════════
   ERROR MESSAGE
══════════════════════════════════════════════════════════════════════════════ */
.sw-ai-message {
    display: none;
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    max-width: 380px;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.sw-ai-message-error {
    background: #1e1010;
    border: 1px solid rgba(255,80,80,0.35);
    color: #ff7070;
}

.sw-ai-message-text { display: block; }

.sw-ai-message-close {
    background: none;
    border: none;
    color: inherit;
    float: right;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    margin-left: 12px;
    opacity: 0.6;
    font-family: inherit;
}

.sw-ai-message-close:hover { opacity: 1; }

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .sw-ai-step-city .sw-ai-button-primary { font-size: 14px; padding: 15px 24px; }
    .sw-ai-step-preview .sw-ai-actions { flex-direction: column; align-items: center; }
    .sw-ai-step-preview .sw-ai-button,
    .sw-ai-step-success .sw-ai-button { width: 100%; }
    .sw-ai-size-options { flex-direction: column; align-items: center; }
    .sw-ai-size-card { min-width: 220px; flex-direction: row; gap: 12px; align-items: center; }
    .sw-ai-success-actions { flex-direction: column; align-items: center; }
}
