:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --accent: #ef4444;
    --accent-dark: #dc2626;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --max-width: 1240px;
    --header-height: 64px;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

h1, h2, h3, h4 {
    line-height: 1.3;
}

.hidden { display: none !important; }

.loading {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    color: #fff;
    font-weight: 500;
    z-index: 9999;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

@keyframes slideUp {
    from { transform: translateY(1rem); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 768px) {
    html { font-size: 14px; }
}

/* ===== AD ZONES ===== */

[data-mv-ad-zone] {
    min-height: 90px;
    background: var(--bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

[data-mv-ad-zone] .mv-ad-container {
    width: 100%;
    text-align: center;
}

[data-mv-ad-zone] .mv-ad-container a {
    display: block;
    text-decoration: none;
}

[data-mv-ad-zone] .mv-ad-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: var(--radius);
}

[data-mv-ad-zone] .mv-ad-container figcaption {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--surface);
    border-radius: 0 0 var(--radius) var(--radius);
}

.ad-zone-banner {
    width: 100%;
    margin: 1rem 0;
    min-height: 90px;
}

.ad-zone-sidebar {
    min-height: 250px;
    margin-bottom: 1rem;
}

.ad-zone-inline {
    margin: 2rem 0;
    min-height: 250px;
}

.ad-zone-hero {
    margin: 1rem 0;
    min-height: 90px;
}

.ad-zone-between {
    margin: 1.5rem 0;
    min-height: 250px;
}

.ad-placeholder {
    color: var(--text-light);
    font-size: 0.85rem;
    text-align: center;
    padding: 2rem 1rem;
}

@media (max-width: 768px) {
    [data-mv-ad-zone] {
        min-height: 50px;
    }
    
    .ad-zone-sidebar,
    .ad-zone-inline,
    .ad-zone-between {
        min-height: 100px;
    }
}
