/* ===========================
   BAMBUHUB GLOBAL STYLES
   Dark Theme, Professional, Consistent
   =========================== */

:root {
    /* Fluid Spacing System */
    --space-3xs: clamp(0.125rem, 0.5vw, 0.25rem);
    --space-2xs: clamp(0.25rem, 0.75vw, 0.5rem);
    --space-xs: clamp(0.5rem, 1vw, 0.75rem);
    --space-sm: clamp(0.75rem, 1.5vw, 1rem);
    --space-md: clamp(1rem, 2vw, 1.5rem);
    --space-lg: clamp(1.5rem, 3vw, 2.5rem);
    --space-xl: clamp(2.5rem, 5vw, 4rem);
    --space-2xl: clamp(4rem, 8vw, 6rem);
    --space-3xl: clamp(6rem, 10vw, 8rem);
    
    /* Modular Typography Scale (1.2 ratio) */
    --text-2xs: clamp(0.694rem, 1.5vw, 0.833rem);
    --text-xs: clamp(0.833rem, 1.8vw, 0.937rem);
    --text-sm: clamp(0.937rem, 2vw, 1rem);
    --text-base: clamp(1rem, 2.2vw, 1.125rem);
    --text-md: clamp(1.125rem, 2.5vw, 1.25rem);
    --text-lg: clamp(1.25rem, 3vw, 1.5rem);
    --text-xl: clamp(1.5rem, 3.5vw, 2rem);
    --text-2xl: clamp(2rem, 4.5vw, 2.75rem);
    --text-3xl: clamp(2.75rem, 6vw, 3.75rem);
    --text-4xl: clamp(3.75rem, 8vw, 5rem);
    
    /* Professional Dark Color Palette */
    --bg-primary: #0a0b0d;
    --bg-secondary: #111215;
    --bg-tertiary: #1a1c20;
    --bg-card: #202226;
    --bg-hover: #282b31;
    --bg-active: #32363d;
    
    /* Text Colors */
    --text-primary: #f7f8f9;
    --text-secondary: #b8bcc4;
    --text-tertiary: #7e8492;
    --text-quaternary: #5a6171;
    
    /* Border Colors */
    --border-primary: #2a2d34;
    --border-secondary: #3a3e47;
    --border-hover: #4a4f5a;
    
    /* Accent Colors (Neutral Blue-Gray) */
    --accent-primary: #5e9bd9;
    --accent-secondary: #4a87c5;
    --accent-tertiary: #3673b1;
    --accent-glow: rgba(94, 155, 217, 0.15);
    --accent-hover: rgba(94, 155, 217, 0.08);
    
    /* Status Colors */
    --success: #4ade80;
    --warning: #fbbf24;
    --error: #f87171;
    --info: #60a5fa;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 4px -1px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -2px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.8);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
    
    /* Animations */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --container-max: 1440px;
    --header-height: 72px;
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 16px;
}

/* ============ RESET & BASE ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

/* Background Gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at top left, rgba(94, 155, 217, 0.03) 0%, transparent 40%),
        radial-gradient(ellipse at bottom right, rgba(94, 155, 217, 0.02) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ============ UTILITIES ============ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============ AD CONTAINERS ============ */
.ad-container {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius-md);
    padding: var(--space-md);
    text-align: center;
    margin: var(--space-xl) 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.ad-container::before {
    content: 'ADVERTISEMENT';
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    letter-spacing: 0.05em;
    color: var(--text-quaternary);
    text-transform: uppercase;
}

.ad-placeholder {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

/* Ad Sizes */
.ad-banner { min-height: 90px; }
.ad-rectangle { min-height: 250px; }
.ad-leaderboard { min-height: 90px; }

/* ============ HEADER ============ */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(17, 18, 21, 0.8);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border-bottom: 1px solid var(--border-primary);
    height: var(--header-height);
}

.header-inner {
    height: 100%;
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    align-items: center;
    gap: var(--space-lg);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: var(--text-lg);
    letter-spacing: -0.02em;
    transition: opacity var(--transition-fast);
}

.logo:hover {
    opacity: 0.9;
}

.logo-icon {
    width: 36px;
    height: 36px;
    color: var(--text-secondary);
}

/* Navigation */
.nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2xs);
}

.nav-link {
    position: relative;
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-link--active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-link--forum {
    color: white;
    background: var(--accent-primary);
    padding: var(--space-xs) var(--space-lg);
}

.nav-link--forum:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Header Actions */
.header-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-sm);
}

.search-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
}

.search-button:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-base);
    white-space: nowrap;
    gap: var(--space-xs);
}

.btn--primary {
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn--secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn--secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-secondary);
}

/* ============ SECTION ============ */
.section {
    padding: var(--space-3xl) 0;
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--space-2xl);
}

.section-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============ FOOTER ============ */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-primary);
    padding: var(--space-2xl) 0 var(--space-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-brand {
    max-width: 320px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: var(--text-lg);
    margin-bottom: var(--space-md);
}

.footer-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.7;
}

.footer-section h3 {
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.footer-link {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--text-primary);
}

.footer-bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* ============ MOBILE MENU ============ */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    :root {
        --header-height: 64px;
    }
    
    .header-inner {
        grid-template-columns: auto 1fr auto;
    }
    
    .header-actions {
        display: none;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav {
        display: none;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
}
/* Site Enhancements Styles */
.printer-badge {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: normal;
    margin-left: 15px;
    vertical-align: middle;
}

.feedback-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px 24px;
    border-radius: 8px;
    border: 1px solid #334155;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.feedback-toast.show {
    opacity: 1;
}

.welcome-back {
    background: #1e293b;
    border: 1px solid #3b82f6;
    padding: 15px;
    border-radius: 8px;
    margin: 20px auto;
    text-align: center;
    color: #e2e8f0;
    max-width: 900px;
}

.welcome-back strong {
    color: #3b82f6;
}

.welcome-back a {
    color: #3b82f6;
    text-decoration: underline;
    margin-left: 10px;
}

.feedback-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-solved, .btn-not-solved {
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
}

.btn-solved {
    background: #10b981;
    color: white;
}

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

.btn-not-solved {
    background: transparent;
    color: #ef4444;
    border: 2px solid #ef4444;
}

.btn-not-solved:hover {
    background: rgba(239, 68, 68, 0.1);
}
