/* ============================================================
   viewer.css — iambored.site Viewer Page
   ============================================================ */

:root {
    --bg-900: #0c0c0f;
    --surface: #1a1a22;
    --surface-2: #22222d;

    --orange-500: #ff8c00;
    --orange-300: #ffad47;
    --orange-glow: rgba(255, 140, 0, 0.2);

    --text-100: #f0f0f5;
    --text-200: #c2c2d0;
    --text-400: #7a7a90;
    --text-500: #55556a;

    --border: rgba(255, 255, 255, 0.07);
    --border-tag: rgba(255, 255, 255, 0.1);

    --bar-height: 64px;

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: 'Outfit', system-ui, sans-serif;
    background: var(--bg-900);
    color: var(--text-200);
}

/* ── Top Bar ── */
.viewer-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--bar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    gap: 1rem;
    z-index: 100;

    /* Glassmorphism subtle touch */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ── Left group ── */
.bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    /* allow shrinking */
    flex: 1;
    overflow: hidden;
}

/* Brand / logo link */
.bar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    transition: opacity var(--transition);
}

.bar-brand:hover {
    opacity: 0.75;
}

.brand-text {
    color: var(--text-100);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-dot {
    color: var(--orange-500);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Divider */
.bar-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    flex-shrink: 0;
}

/* Site info block */
.bar-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    overflow: hidden;
}

.info-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-100);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.site-url-link {
    color: var(--text-500);
    text-decoration: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color var(--transition);
}

.site-url-link:hover {
    color: var(--orange-300);
}

.external-icon {
    width: 13px;
    height: 13px;
}

.site-desc {
    font-size: 0.78rem;
    color: var(--text-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 520px;
    line-height: 1.3;
}

/* Tag chips in bar */
.site-tags {
    display: flex;
    gap: 0.35rem;
    flex-wrap: nowrap;
    overflow: hidden;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--border-tag);
    background: var(--surface-2);
    color: var(--text-400);
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.tag-emoji {
    font-size: 0.75em;
}

/* ── Right group ── */
.bar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.next-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    border-radius: 999px;
    border: none;
    background: var(--orange-500);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 18px rgba(255, 140, 0, 0.35);
}

.next-btn:hover {
    background: #e67a00;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(255, 140, 0, 0.5);
}

.next-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 140, 0, 0.3);
    transition-duration: 0.08s;
}

.next-btn:focus-visible {
    outline: 2px solid var(--orange-300);
    outline-offset: 3px;
}

.next-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ── Iframe wrapper ── */
.iframe-wrapper {
    position: fixed;
    top: var(--bar-height);
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.site-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
    display: block;
}

/* ── Loading overlay ── */
.iframe-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-900);
    gap: 1.25rem;
    z-index: 10;
    transition: opacity 0.35s ease;
}

.iframe-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 140, 0, 0.2);
    border-top-color: var(--orange-500);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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

.loading-text {
    font-size: 0.9rem;
    color: var(--text-500);
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* ── Blocked fallback ── */
.iframe-blocked {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-900);
    z-index: 10;
    overflow-y: auto;
    padding: 2rem 1rem;
    gap: 1.5rem;
}

/* CSS display:flex above overrides the browser's [hidden]{display:none} — fix that */

/* ── Screenshot Preview ── */
.blocked-screenshot-wrap {
    width: 100%;
    max-width: 780px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    position: relative;
}

.blocked-screenshot-wrap[hidden] {
    display: none;
}

.blocked-screenshot-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    aspect-ratio: 16 / 8;
    position: relative;
    overflow: hidden;
}

.screenshot-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.02) 0%,
        rgba(255, 255, 255, 0.06) 40%,
        rgba(255, 255, 255, 0.02) 80%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

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

.screenshot-loading-text {
    font-size: 0.85rem;
    color: var(--text-500);
    font-weight: 500;
    position: relative;
    z-index: 1;
    letter-spacing: 0.03em;
}

.blocked-screenshot-img {
    width: 100%;
    display: block;
    border-radius: 16px;
    animation: fadeIn 0.5s ease;
}

.blocked-screenshot-img[hidden] {
    display: none;
}

.blocked-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    max-width: 420px;
    flex-shrink: 0;
}

/* ── BUTTONS ────────────────────────────────────────────────── */
.report-btn,
.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.report-btn:hover,
.share-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff9d00;
    border-color: rgba(255, 157, 0, 0.3);
}

.report-icon,
.share-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

@media (max-width: 600px) {

    .report-btn-label,
    .share-btn-label {
        display: none;
    }

    .report-btn,
    .share-btn {
        padding: 10px;
    }
}

/* ── MODAL ─────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    /* Overrides default [hidden] { display: none } */
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 32px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content h3 {
    margin: 0 0 8px;
    font-size: 24px;
    color: #fff;
    font-weight: 700;
}

.modal-subtitle {
    color: #888;
    font-size: 14px;
    margin-bottom: 24px;
}

/* ── FORM ──────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #bbb;
    font-weight: 500;
}

.form-group select,
.form-group textarea {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    padding: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff9d00;
    background: #333;
}

.form-group textarea {
    height: 100px;
    resize: none;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-cancel,
.btn-submit {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-submit {
    background: #ff9d00;
    border: none;
    color: #000;
}

.btn-submit:hover {
    background: #ffb333;
    transform: translateY(-2px);
}

/* ── TOAST ─────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a1a1a;
    color: #fff;
    padding: 12px 24px;
    border: 1px solid rgba(255, 157, 0, 0.3);
    border-radius: 50px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 3000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.iframe-blocked[hidden] {
    display: none;
}

.blocked-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
    max-width: 420px;
}

.blocked-icon {
    font-size: 3.5rem;
}

.blocked-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-100);
    letter-spacing: -0.02em;
}

.blocked-desc {
    font-size: 0.9rem;
    color: var(--text-400);
    line-height: 1.6;
}

.blocked-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.5rem;
}

.blocked-open-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    background: var(--orange-500);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: background var(--transition), transform var(--transition);
    box-shadow: 0 4px 18px var(--orange-glow);
}

.blocked-open-btn:hover {
    background: #e67a00;
    transform: translateY(-1px);
}

.blocked-next-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-200);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
}

.blocked-next-btn:hover {
    border-color: var(--text-400);
    color: var(--text-100);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    :root {
        --bar-height: 56px;
    }

    .viewer-bar {
        padding: 0 0.9rem;
        gap: 0.75rem;
    }

    .bar-divider {
        display: none;
    }

    .site-title {
        max-width: 150px;
        font-size: 0.85rem;
    }

    .site-desc {
        display: none;
    }

    .site-tags {
        display: none;
    }

    .brand-text,
    .brand-dot {
        font-size: 0.9rem;
    }

    .next-btn-label {
        display: none;
    }

    .next-btn {
        padding: 0.55rem 0.7rem;
        border-radius: 50%;
        aspect-ratio: 1;
        justify-content: center;
    }

    .next-icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .site-title {
        max-width: 110px;
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .loading-spinner {
        animation: none;
        border-top-color: var(--orange-500);
    }
}