/* ============================================
   BHOGI - STRUCTURAL DESIGN TOKENS

   PHILOSOPHY: theme.json is the SINGLE source of truth for ALL colors.
   This file contains ONLY structural tokens (spacing, radius, motion, etc.)
   that are theme-agnostic and never change.

   See: BHOGI_ENTERPRISE_DESIGN_SYSTEM.md
   ============================================ */

/* ─────────────────────────────────────────────
   STRUCTURAL TOKENS (Theme-Independent)
   ───────────────────────────────────────────── */
:root {
    /* ═══════════════════════════════════════
       BORDER RADIUS (Consistent across themes)
       ═══════════════════════════════════════ */
    --bhogi-radius-xs: 0.375rem;   /* 6px */
    --bhogi-radius-sm: 0.5rem;     /* 8px */
    --bhogi-radius: 0.875rem;      /* 14px */
    --bhogi-radius-md: 0.875rem;   /* 14px */
    --bhogi-radius-lg: 1.25rem;    /* 20px */
    --bhogi-radius-xl: 1.75rem;    /* 28px */
    --bhogi-radius-2xl: 2.25rem;   /* 36px */
    --bhogi-radius-full: 9999px;

    /* ═════════════════════════════════════
       SPACING SCALE (8px Grid System)
       ═══════════════════════════════════════ */
    --space-xs: 0.25rem;    /* 4px */
    --space-sm: 0.5rem;     /* 8px - Base unit */
    --space-md: 0.75rem;    /* 12px */
    --space-base: 1rem;     /* 16px - Standard gap */
    --space-lg: 1.5rem;     /* 24px */
    --space-xl: 2rem;       /* 32px - Section spacing */
    --space-2xl: 3rem;      /* 48px */
    --space-3xl: 4rem;      /* 64px - Hero sections */

    /* ═══════════════════════════════════════
       MOTION & ANIMATION
       ═══════════════════════════════════════ */
    --bhogi-transition-instant: 0ms;
    --bhogi-transition-fast: 150ms;
    --bhogi-transition-base: 250ms;
    --bhogi-transition-slow: 350ms;
    --bhogi-transition-lazy: 500ms;

    --bhogi-ease: cubic-bezier(0.4, 0, 0.2, 1);           /* Material Design */
    --bhogi-ease-spring: cubic-bezier(0.16, 1, 0.3, 1);   /* Elastic bounce */
    --bhogi-ease-out: cubic-bezier(0, 0, 0.2, 1);         /* Deceleration */
    --bhogi-ease-in: cubic-bezier(0.4, 0, 1, 1);          /* Acceleration */
    --bhogi-ease-in-out: cubic-bezier(0.42, 0, 0.58, 1);  /* Smooth */

    /* ═══════════════════════════════════════
       Z-INDEX LAYERS
       ═══════════════════════════════════════ */
    --z-base: 1;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;

    /* ═══════════════════════════════════════
       FLUID TYPOGRAPHY (Modular Scale 1.25)
       ═══════════════════════════════════════ */
    --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);      /* 12-14px */
    --font-size-sm: clamp(0.875rem, 0.825rem + 0.25vw, 1rem);       /* 14-16px */
    --font-size-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);      /* 16-18px */
    --font-size-lg: clamp(1.125rem, 1.05rem + 0.375vw, 1.25rem);    /* 18-20px */
    --font-size-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);        /* 20-24px */
    --font-size-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 2rem);         /* 24-32px */
    --font-size-3xl: clamp(1.875rem, 1.65rem + 1.125vw, 2.5rem);    /* 30-40px */
    --font-size-4xl: clamp(2.25rem, 1.95rem + 1.5vw, 3rem);         /* 36-48px */

    /* ═══════════════════════════════════════
       FONT STACKS (System Fonts)
       ═══════════════════════════════════════ */
    --font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-serif: Georgia, Cambria, "Times New Roman", Times, serif;
    --font-family-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    /* Line Heights for Readability */
    --line-height-tight: 1.25;
    --line-height-base: 1.6;
    --line-height-relaxed: 1.75;
}

/* ─────────────────────────────────────────────
   NOTE: ALL COLORS ARE INJECTED BY ThemeService

   Colors are defined in theme.json and injected
   at runtime by ThemeService.cs (lines 159-294).

   This ensures:
   - Single source of truth (theme.json)
   - Dynamic theme switching
   - Multi-tenant white-label support
   - No duplication or sync issues
   ─────────────────────────────────────────────  */

/* ─────────────────────────────────────────────
   BROWSER DEFAULTS & RESETS
   ───────────────────────────────────────────── */

/* Box-sizing for predictable layouts */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Root element setup */
html {
    /* Performance */
    /* scroll-behavior: smooth is intentionally omitted here.
       Applying it to <html> causes Blazor's scroll restoration on navigation/reload
       to visibly animate as a "jump to top". Use scroll-behavior on specific
       containers instead (e.g., .smooth-scroll { scroll-behavior: smooth; }) */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;

    /* Layout */
    width: 100%;
    min-height: 100%;
    overflow-x: clip;

    /* Typography */
    font-family: var(--font-family-sans);
    font-size: 16px; /* Never change - rem calculations depend on this */
    line-height: var(--line-height-base);
}

/* Body defaults (colors injected by ThemeService) */
body {
    /* Typography */
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);

    /* Layout */
    min-height: 100vh;
    overflow-x: hidden;

    /* Mobile optimization */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;

    /* Colors set by ThemeService.cs */
    color: var(--bhogi-text);
    background: var(--bhogi-surface-raised);
}

/* Media elements - responsive by default */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Links - colors from ThemeService */
a {
    color: var(--bhogi-link);
    text-decoration: none;
    transition: color var(--bhogi-transition-fast) var(--bhogi-ease);
}

a:hover {
    color: var(--bhogi-link-hover);
}

/* Remove list styles */
ul,
ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Form elements inherit font */
button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

/* Remove button defaults */
button {
    background: none;
    border: none;
    cursor: pointer;
}

/* ─────────────────────────────────────────────
   ACCESSIBILITY (WCAG AAA)
   ───────────────────────────────────────────── */

/* Focus styles - colors from ThemeService */
:focus-visible {
    outline: 3px solid var(--bhogi-primary);
    outline-offset: 2px;
    border-radius: var(--bhogi-radius-sm);
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Enhanced focus for interactive elements */
a:focus-visible,
button:focus-visible {
    box-shadow: var(--bhogi-focus-ring);
}

/* Screen reader only content */
.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;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--bhogi-primary);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* ─────────────────────────────────────────────
   TEXT SELECTION (colors from ThemeService)
   ───────────────────────────────────────────── */
::selection {
    background: var(--bhogi-primary-light);
    color: var(--bhogi-primary-dark);
}

::-moz-selection {
    background: var(--bhogi-primary-light);
    color: var(--bhogi-primary-dark);
}

/* ─────────────────────────────────────────────
   SCROLLBAR (Webkit browsers)
   ───────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bhogi-border-strong);
    border-radius: var(--bhogi-radius-full);
    transition: background var(--bhogi-transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bhogi-primary);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bhogi-border-strong) transparent;
}

/* ─────────────────────────────────────────────
   MOTION PREFERENCES
   ───────────────────────────────────────────── */

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    button,
    a {
        text-decoration: underline;
    }
}

/* ─────────────────────────────────────────────
   PRINT STYLES
   ───────────────────────────────────────────── */
@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    img {
        page-break-inside: avoid;
    }

    h2,
    h3,
    p {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}

/* ═══════════════════════════════════════════════
   HEADER NAVIGATION - GLOBAL STYLES
   (Bypasses Blazor CSS isolation for .nav-link)
   ═══════════════════════════════════════════════ */

/* Navigation container */
.header-nav {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem;
    flex-wrap: nowrap !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

/* Header section - Move menu up */
html .header,
.header {
    margin-top: -0.5rem !important;
}

/* Nav items */
.header-nav .nav-item {
    position: relative;
    display: flex !important;
    align-items: center !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove separators */
.header-nav .nav-item::before,
.header-nav .nav-item::after {
    display: none !important;
    content: none !important;
}

/* Nav links - ULTRA CLEAN - No boxes, no borders */
.header-nav .nav-link,
.header-nav a.nav-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.375rem;
    padding: 0.75rem 1.125rem !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: var(--bhogi-text) !important;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 0;
    border: none;
    background: none;
    box-shadow: none;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    margin: 0;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* Nav link hover - Subtle smooth effect only */
.header-nav .nav-link:hover,
.header-nav a.nav-link:hover {
    color: var(--bhogi-primary) !important;
    background: none;
    box-shadow: none;
    border: none;
    transform: none;
    letter-spacing: 0.05em;
}

/* Clean gold underline accent on hover */
.header-nav .nav-link::after,
.header-nav a.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--bhogi-primary);
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: left;
    border-radius: 1px;
}

.header-nav .nav-link:hover::after,
.header-nav a.nav-link:hover::after {
    transform: scaleX(1);
}

/* ═══════════════════════════════════════════════
   HEADER COMPONENTS - GLOBAL OVERRIDES
   (Remove boxes, apply clean premium styles)
   ═══════════════════════════════════════════════ */

/* Logo - Clean without heavy boxes */
html .logo,
.logo {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0.45rem 0.5rem !important;
}

html .logo:hover,
.logo:hover {
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
    opacity: 0.8;
}

/* Search Box - Clean minimal style */
html .search-box,
.search-box {
    border: 1px solid var(--bhogi-border) !important;
    box-shadow: none !important;
    background: var(--bhogi-surface-raised) !important;
}

html .search-box:focus-within,
.search-box:focus-within {
    border-color: var(--bhogi-primary) !important;
    box-shadow: 0 0 0 3px var(--bhogi-primary-glow) !important;
}

/* Header Icon Buttons - Clean without boxes */
html .header-icon-btn,
.header-icon-btn {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.125rem !important;
    text-align: center !important;
    padding: 0.5rem 0.75rem !important;
}

html .header-icon-btn:hover,
.header-icon-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: none !important;
    border: none !important;
    background: rgba(var(--bhogi-primary-rgb), 0.08) !important;
}

html .header-icon-btn::before,
html .header-icon-btn::after,
.header-icon-btn::before,
.header-icon-btn::after {
    display: none !important;
}

/* Icon Wrapper - Clean circular badges */
html .icon-wrapper,
.icon-wrapper {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

/* Header Icons - Better size and styling */
html .icon-wrapper i,
.icon-wrapper i {
    font-size: 1.5rem !important;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.15)) !important;
    transition: transform 0.2s ease !important;
}

html .header-icon-btn:hover .icon-wrapper i,
.header-icon-btn:hover .icon-wrapper i {
    transform: scale(1.1) !important;
}

/* Icon Badge - Clean number circles */
html .icon-badge,
.icon-badge {
    border: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    position: absolute !important;
    top: -4px !important;
    right: -6px !important;
}

/* Icon Labels - Clean text centered below icon */
html .icon-label,
.icon-label {
    border: none !important;
    box-shadow: none !important;
    text-align: center !important;
    display: block !important;
}

/* Mobile Action Buttons - Clean */
.mobile-action-btn {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.mobile-icon-wrapper {
    border: none !important;
    box-shadow: none !important;
}

.mobile-icon-badge {
    border: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

/* ═══════════════════════════════════════════════
   TOPBAR MENUBAR - GLOBAL OVERRIDES
   (Remove gold borders and heavy shadows)
   ═══════════════════════════════════════════════ */

/* Announcement Bar - Clean without gold glow */
html .announcement-bar,
.announcement-bar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

html .announcement-item,
.announcement-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

html .announcement-item i,
.announcement-item i {
    color: rgba(255, 215, 0, 0.9) !important;
    font-size: 0.75rem !important;
}

html .announcement-item strong,
.announcement-item strong {
    color: #FFD700 !important;
}

html .announcement-separator,
.announcement-separator {
    color: rgba(218, 165, 32, 0.4) !important;
}

/* Menubar Section - Clean */
html .menubar-section.menubar-inverse,
.menubar-section.menubar-inverse {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
}

/* Menubar Links - Clean style */
html .menubar-link,
.menubar-link {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Menubar Icons - Better visibility and styling */
html .menubar-icon,
.menubar-icon {
    font-size: 1.1rem !important;
    margin-right: 0.5rem !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2)) !important;
    transition: transform 0.2s ease !important;
}

html .menubar-link:hover .menubar-icon,
.menubar-link:hover .menubar-icon {
    transform: scale(1.1) !important;
}

html .menubar-link::before,
.menubar-link::before {
    display: none !important;
}

html .menubar-inverse .menubar-link:hover,
.menubar-inverse .menubar-link:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
    border: none !important;
    transform: none !important;
    letter-spacing: 0.06em !important;
}

html .menubar-inverse .menubar-link:active,
.menubar-inverse .menubar-link:active {
    background-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: none !important;
}

/* Support Hotline - Special emphasis */
html .menubar-link--support:hover,
.menubar-link--support:hover {
    background-color: rgba(255, 215, 0, 0.1) !important;
    color: rgba(255, 215, 0, 0.95) !important;
}

/* Social Links - Clean icons */
html .social-link,
.social-link {
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: none !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

html .social-link::before,
.social-link::before {
    display: none !important;
}

html .social-link:hover,
.social-link:hover {
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Keep platform-specific colors on hover - they look good! */
html .social-link[href*="facebook"]:hover,
.social-link[href*="facebook"]:hover {
    background: linear-gradient(135deg, #1877f2 0%, #0e5fc5 100%) !important;
    border-color: #1877f2 !important;
    box-shadow: 0 4px 10px rgba(24, 119, 242, 0.4) !important;
}

html .social-link[href*="twitter"]:hover,
html .social-link[href*="x-twitter"]:hover,
.social-link[href*="twitter"]:hover,
.social-link[href*="x-twitter"]:hover {
    background: linear-gradient(135deg, #000000 0%, #2b2b2b 100%) !important;
    border-color: #000000 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5) !important;
}

html .social-link[href*="instagram"]:hover,
.social-link[href*="instagram"]:hover {
    background: linear-gradient(135deg, #e1306c 0%, #c13584 50%, #833ab4 100%) !important;
    border-color: #e1306c !important;
    box-shadow: 0 4px 10px rgba(225, 48, 108, 0.4) !important;
}

html .social-link[href*="linkedin"]:hover,
.social-link[href*="linkedin"]:hover {
    background: linear-gradient(135deg, #0077b5 0%, #005582 100%) !important;
    border-color: #0077b5 !important;
    box-shadow: none !important;
}
