/* Viads Demo - Global Styles */
:root {
    --primary-color: #2563eb;
    --text-color: #1f2937;
    --bg-color: #ffffff;
    --border-color: #e5e7eb;
    --accent-color: #f3f4f6;
    --max-width: 760px;
    --header-height: 64px;
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
}

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

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
}

.header-content {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo img {
    height: 35px;
    width: auto;
    transition: transform 0.2s ease;
}

.logo .logo-desktop {
    height: 35px;
    width: auto;
}

.logo .logo-mobile {
    height: 25px;
    width: auto;
}

.logo .logo-mobile {
    display: none !important;
}

.logo:hover img {
    transform: scale(1.05);
}

/* Navigation */
.nav {
    display: flex;
    gap: var(--spacing-md);
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: var(--accent-color);
}

.nav-link[aria-current="page"] {
    background-color: var(--primary-color);
    color: white;
}

/* Language switcher */
.language-switcher {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    font-size: 0.875rem;
    cursor: pointer;
    min-width: 60px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
}

/* Main content */
.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
}

.page-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: var(--spacing-xl);
    line-height: 1.5;
}

/* Content sections */
.content-section {
    margin-bottom: var(--spacing-xl);
}

.hero-placeholder {
    width: 100%;
    height: 300px;
    background: var(--accent-color);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 1.125rem;
    margin-bottom: var(--spacing-lg);
}

.article-text {
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

/* Headings */
.content-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 2px solid var(--accent-color);
}

.content-section h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

/* Ad slot utilities */
.slot-reserved {
    min-height: 280px;
    width: 100%;
    margin: var(--spacing-md) 0;
    background: var(--accent-color);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.875rem;
}

.slot-leaderboard {
    min-height: 90px;
    width: 100%;
    background: var(--accent-color);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
}

.slot-mpu {
    min-height: 250px;
    width: 100%;
    background: var(--accent-color);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Grid layouts */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--spacing-lg);
    align-items: start;
}

.sidebar {
    background: var(--accent-color);
    padding: var(--spacing-md);
    border-radius: 8px;
    min-height: 400px;
}

/* FAQ/Docs layout */
.faq-section {
    margin-bottom: var(--spacing-lg);
}

.faq-question {
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
}

.faq-answer {
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
    color: #4b5563;
}

/* Footer */
.footer {
    background: var(--accent-color);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-lg) var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-links {
    display: flex;
    gap: var(--spacing-md);
}

.footer-link {
    color: var(--text-color);
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        padding: 0 var(--spacing-sm);
    }
    
    .header-content {
        gap: var(--spacing-sm);
    }
    
    .nav {
        gap: var(--spacing-sm);
    }
    
    .nav-link {
        padding: var(--spacing-xs);
        font-size: 0.875rem;
    }
    
    .language-switcher {
        min-width: 55px;
        font-size: 0.8rem;
    }
    
    .main {
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .sidebar {
        order: -1;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo .logo-desktop {
        display: none !important;
    }
    
    .logo .logo-mobile {
        display: block !important;
        height: 30px !important;
        width: auto !important;
    }
}

@media (max-width: 600px) {
    .header-content {
        gap: var(--spacing-sm);
        justify-content: space-between; /* Distribute items evenly */
    }
    
    .nav {
        display: none !important;
    }
    
    .mobile-dropdown {
        display: block !important; /* Force show on mobile */
        /* Center the dropdown */
    }
    
    .signup-button {
        /* Remove margin-left: auto to keep it closer to dropdown */
        margin-right: var(--spacing-xs); /* Reduce space between signup and language switcher */
    }
    
    .language-switcher {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        margin-left: auto; /* Push language switcher to the right */
    }
    
    .logo .logo-desktop {
        display: none !important;
    }
    
    .logo .logo-mobile {
        display: block !important;
        height: 30px !important;
        width: auto !important;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: row; /* Keep horizontal layout */
        height: auto;
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
        align-items: center;
        justify-content: space-between; /* Distribute items evenly */
    }
    
    .logo {
        margin-bottom: 0; /* Remove bottom margin */
        flex-shrink: 0; /* Prevent logo from shrinking */
    }
    
    .logo .logo-desktop {
        display: none !important;
    }
    
    .logo .logo-mobile {
        display: block !important;
        height: 30px !important;
        width: auto !important;
    }
    
    .nav {
        display: none !important;
    }
    
    .mobile-dropdown {
        margin: 0;
        /* Center the dropdown */
    }
    
    .signup-button {
        /* Remove margin-left: auto to keep it closer to dropdown */
        margin-right: var(--spacing-xs); /* Reduce space between signup and language switcher */
        font-size: 0.8rem; /* Smaller font for mobile */
        padding: var(--spacing-xs);
    }
    
    .language-switcher {
        margin: 0;
        min-width: 50px;
        font-size: 0.75rem;
        background-size: 14px;
        padding-right: 28px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        margin-left: auto; /* Push language switcher to the right */
    }
}

/* Focus styles for accessibility */
.nav-link:focus,
.language-switcher:focus,
.footer-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Sign-up button */
.signup-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}

.signup-button:hover {
    background-color: #1d4ed8; /* Darker blue on hover */
}

.signup-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Mobile dropdown menu */
.mobile-dropdown {
    display: none; /* Hide by default, show only on mobile */
    position: relative;
}

.mobile-dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 0.9rem;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.2s;
}

.mobile-dropdown-toggle:hover {
    /* Remove hover background */
}

.mobile-dropdown-toggle:focus {
    /* Remove focus background */
    outline: none; /* Remove focus outline */
}

.mobile-dropdown-toggle::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    transition: transform 0.2s;
}

.mobile-dropdown.active .mobile-dropdown-toggle::after {
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    min-width: 150px;
}

.mobile-dropdown.active .mobile-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-dropdown-item {
    display: block;
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--text-color);
    text-decoration: none;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mobile-dropdown-item:hover,
.mobile-dropdown-item:focus {
    background-color: var(--accent-color);
}

.mobile-dropdown-item[aria-current="page"] {
    background-color: var(--primary-color);
    color: white;
}

/* Floating ad anchor utility (not applied by default) */
.viads-floating-anchor {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 1000;
}
