/**
 * Plinkly – Interstitial Styles
 * Modern, Minimalist UI & Custom Modal Ad System
 */

:root {
    --bg-body: #fafafa;
    --bg-card: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --accent: #0051c3;
    --accent-hover: #003e9c;
    --danger: #ef4444;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #0f172a;
        --bg-card: #1e293b;
        --text-primary: #f8fafc;
        --text-secondary: #94a3b8;
        --accent: #3b82f6;
        --shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
}

.nav-header { position: absolute; top: 0; left: 0; right: 0; padding: 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.brand-logo { font-weight: 800; font-size: 1.25rem; color: var(--text-primary); text-decoration: none; letter-spacing: -0.5px; }
.report-link { font-size: 0.85rem; color: var(--text-secondary); text-decoration: none; display: flex; align-items: center; gap: 6px; transition: color 0.2s;}
.report-link:hover { color: var(--danger); }

.preview-card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); width: 90%; max-width: 400px; padding: 2.5rem 2rem; text-align: center; border: 1px solid rgba(148, 163, 184, 0.1); }
.domain-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(107, 114, 128, 0.08); color: var(--text-secondary); padding: 6px 14px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; margin-bottom: 1.5rem; }

.spinner { width: 40px; height: 40px; border: 3px solid rgba(0, 81, 195, 0.1); border-left-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1.5rem; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

h1 { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.5rem; color: var(--text-primary); }
p { font-size: 0.95rem; color: var(--text-secondary); margin: 0 0 2rem; line-height: 1.5; }

.btn-main { display: flex; align-items: center; justify-content: center; width: 100%; padding: 14px; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: all 0.2s ease; box-sizing: border-box; font-family: inherit; }
.btn-primary { background: var(--accent); color: #ffffff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

.hidden { display: none !important; }
.upsell-link { margin-top: 1.5rem; font-size: 0.8rem; color: var(--text-secondary); display: block; text-decoration: none; }
.upsell-link:hover { color: var(--text-primary); text-decoration: underline; }

.pass-input { width: 100%; padding: 14px; border-radius: 8px; border: 1px solid rgba(148, 163, 184, 0.4); background: var(--bg-body); color: var(--text-primary); margin-bottom: 1rem; box-sizing: border-box; font-family: inherit; font-size: 1rem; text-align: center; outline: none; transition: border-color 0.2s; }
.pass-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 81, 195, 0.1); }

/* --- Modal Styles (Apple/Safari Optimized) --- */
.ad-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    /* نضعه في المقدمة لنجبر سفاري على تحميله وعدم تجميده */
    z-index: 9999; 
    /* الشفافية 0 تبقيه مخفياً عن المستخدم، لكن أبعاده موجودة ليقرأها Adsterra */
    opacity: 0; 
    background: transparent;
    pointer-events: none;
    transition: opacity 0.3s ease, background 0.3s ease;
}

.ad-modal-overlay.active {
    opacity: 1; 
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    pointer-events: auto;
}

.ad-modal-content {
    background: var(--bg-card); width: 90%; max-width: 500px;
    border-radius: var(--radius); box-shadow: var(--shadow);
    display: flex; flex-direction: column; overflow: hidden;
    transform: scale(0.95); 
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ad-modal-overlay.active .ad-modal-content {
    transform: scale(1); 
}

.ad-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.5rem; border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(148, 163, 184, 0.03);
}

.ad-modal-title { font-weight: 600; font-size: 0.85rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

.ad-modal-close {
    background: var(--accent); color: white; border: none; padding: 8px 16px;
    border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 0.9rem;
    transition: background 0.2s; display: flex; align-items: center; gap: 6px;
}

.ad-modal-close:hover { background: var(--accent-hover); }

.ad-modal-body {
    padding: 2rem 1rem; display: flex; justify-content: center; align-items: center; min-height: 250px;
}