/**
 * Brewhauser Generated Pages - Shared Component Library
 * Mobile-First Design System
 * Consistent styling for State, City, and Brewery pages
 */

/* ============================================
   CSS VARIABLES - Design Tokens
   ============================================ */
:root {
    /* Primary Colors */
    --primary-amber: #F5A623;
    --primary-gold: #FCD34D;
    --gold-accent: #D4AF37;

    /* Secondary Colors */
    --secondary-navy: #0F172A;
    --secondary-slate: #1E293B;
    --secondary-charcoal: #334155;

    /* Text Colors */
    --text-primary: #FEFCE8;
    --text-secondary: #FEF3C7;
    --text-muted: rgba(254, 252, 232, 0.7);

    /* Glass Effects */
    --glass-white: rgba(255, 255, 255, 0.08);
    --glass-gold: rgba(251, 191, 36, 0.1);
    --shadow-dark: rgba(15, 23, 42, 0.4);

    /* Spacing Scale */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--secondary-navy);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100%;
}

/* Global Link Styles - Override browser defaults */
a {
    color: var(--primary-amber);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

a:visited {
    color: var(--primary-amber);
}

/* ============================================
   BACKGROUND EFFECTS
   ============================================ */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(170deg, #0F172A 0%, #1E293B 40%, #334155 70%, #1E293B 100%);
    z-index: -2;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -100px;
    background: radial-gradient(circle at 30% 30%, rgba(252, 211, 77, 0.3), rgba(245, 166, 35, 0.1));
    border-radius: 50%;
    opacity: 0.6;
    animation: rise 7s infinite ease-in;
}

@keyframes rise {
    0% {
        bottom: -100px;
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        bottom: 110vh;
        opacity: 0;
    }
}

/* ============================================
   NAVIGATION COMPONENT
   ============================================ */
.nav-premium {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.75));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(251, 191, 36, 0.1);
    padding: 1rem 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(15, 23, 42, 0.4);
    height: 70px;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.logo-mark {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Beer Mug Logo Animation */
.mini-beer-mug {
    width: 32px;
    height: 36px;
    position: relative;
}

.mini-mug-body {
    width: 24px;
    height: 32px;
    position: absolute;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border: 2px solid var(--primary-amber);
    border-radius: 0 0 3px 3px;
    overflow: hidden;
}

.mini-beer-liquid {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 92%;
    background: linear-gradient(to top, #8B4513 0%, #A0522D 60%, #D2A679 100%);
}

.mini-foam-layer {
    position: absolute;
    top: 8%;
    width: 100%;
    height: 6px;
    background: linear-gradient(180deg, rgba(255, 248, 225, 0.95), rgba(255, 248, 225, 0.8));
    border-radius: 50% 50% 0 0;
}

.mini-mug-handle {
    position: absolute;
    right: -7px;
    top: 9px;
    width: 8px;
    height: 22px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-left: none;
    border-radius: 0 5px 5px 0;
}

.logo-text {
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-amber) 50%, #D97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-gold);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-cta {
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-amber) 100%);
    color: var(--secondary-navy);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.3s;
    display: inline-block;
}

.nav-cta:hover {
    transform: translateY(-2px);
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: 2px solid var(--primary-gold);
    border-radius: 8px;
    color: var(--primary-gold);
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
    width: 48px;
    height: 48px;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    right: 0;
    width: 300px;
    height: calc(100vh - 70px);
    background: linear-gradient(170deg, var(--secondary-navy) 0%, var(--secondary-slate) 100%);
    padding: 2rem;
    z-index: 999;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu a {
    display: block;
    color: var(--text-secondary);
    padding: 1rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    margin: 80px auto 1rem;
    max-width: 1200px;
    padding: 0 2rem;
    font-size: 0.85rem;
}

.breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: rgba(245, 166, 35, 0.4);
}

.breadcrumb a {
    color: var(--primary-amber);
    text-decoration: none;
}

.breadcrumb li:last-child {
    color: rgba(245, 245, 245, 0.7);
}

/* ============================================
   PAGE HEADERS
   ============================================ */
.page-header {
    text-align: center;
    padding: 3rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-amber), var(--gold-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.page-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.9;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.state-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(245, 166, 35, 0.3);
}

.state-name {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--primary-amber);
}

.state-count {
    font-size: 1rem;
    opacity: 0.8;
    padding: 0.25rem 0.75rem;
    background: rgba(245, 166, 35, 0.1);
    border-radius: 20px;
}

.city-header {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    color: var(--text-primary);
}

/* ============================================
   CARD COMPONENTS
   ============================================ */
.brewery-card, .city-card {
    background: rgba(26, 43, 60, 0.7);
    border: 1px solid rgba(245, 166, 35, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.brewery-card:hover, .city-card:hover {
    background: rgba(26, 43, 60, 0.9);
    border-color: rgba(245, 166, 35, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.1);
}

.brewery-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
    max-width: 100%;
}

.brewery-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-amber);
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.brewery-type {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.3);
    border-radius: 20px;
    color: var(--primary-amber);
    white-space: nowrap;
    flex-shrink: 0;
}

.brewery-address {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.brewery-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(245, 166, 35, 0.1);
}

.brewery-distance {
    font-size: 0.85rem;
    color: rgba(245, 166, 35, 0.9);
}

.info-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(245, 166, 35, 0.2);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.info-card h2 {
    color: var(--primary-amber);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(245, 166, 35, 0.15);
}

/* ============================================
   GRID SYSTEMS
   ============================================ */
.responsive-grid, .brewery-grid, .cities-grid {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.grid-3-col {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.grid-4-col {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.breweries-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.cities-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ============================================
   BUTTONS & INTERACTIVE ELEMENTS
   ============================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-amber) 100%);
    color: var(--secondary-navy);
    padding: 1.25rem 3rem;
    border-radius: 60px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s;
    min-height: 60px;
}

.btn-primary:hover {
    transform: translateY(-3px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 54px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.maps-link {
    padding: 0.4rem 0.8rem;
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.3);
    border-radius: 20px;
    color: var(--primary-amber);
    text-decoration: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.maps-link:hover {
    background: rgba(245, 166, 35, 0.2);
    border-color: var(--primary-amber);
}

/* Filter Chips */
.filter-chip, .filter-btn {
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(245, 166, 35, 0.3);
    border-radius: 30px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filter-chip:hover, .filter-btn:hover, .filter-chip.active, .filter-btn.active {
    background: rgba(245, 166, 35, 0.1);
    border-color: var(--primary-amber);
    color: var(--primary-gold);
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
    background: rgba(26, 43, 60, 0.6);
    border: 1px solid rgba(245, 166, 35, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 1200px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.filter-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-amber);
    margin-right: 0.5rem;
}

/* ============================================
   SUMMARY STATS
   ============================================ */
.summary-stats {
    margin: 2rem auto;
    max-width: 1200px;
    padding: 1.5rem;
    background: rgba(26, 43, 60, 0.4);
    border: 1px solid rgba(245, 166, 35, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    text-align: center;
    padding: 1rem;
    background: rgba(245, 166, 35, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(245, 166, 35, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-amber);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brewery-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.type-badge {
    padding: 0.5rem 1rem;
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.3);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.type-badge span {
    color: var(--primary-amber);
    font-weight: 600;
}

/* ============================================
   LOADING & ERROR STATES
   ============================================ */
.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 4rem auto;
    border: 3px solid rgba(245, 166, 35, 0.2);
    border-top: 3px solid var(--primary-amber);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   FOOTER
   ============================================ */
.footer-premium {
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid rgba(245, 166, 35, 0.2);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3, .footer-section h4 {
    color: var(--primary-amber);
    margin-bottom: 1rem;
}

.footer-section a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary-gold);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(245, 166, 35, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.trust-badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.trust-badges .badge {
    padding: 0.5rem 1rem;
    background: rgba(245, 166, 35, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
}

.footer-legal {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.footer-legal a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-legal a:hover {
    color: var(--primary-gold);
}

/* ============================================
   MOBILE BREAKPOINTS
   ============================================ */
@media (max-width: 768px) {
    /* Navigation */
    .nav-premium {
        padding: 0.5rem 0;
        height: 56px;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .nav-links, .nav-right {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Typography */
    .page-title {
        font-size: 2rem;
    }

    .page-header {
        padding: 2rem 1rem;
    }

    /* Grids */
    .grid-3-col, .grid-4-col, .breweries-grid, .cities-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
    }

    /* Breadcrumb */
    .breadcrumb {
        margin-top: 70px;
        padding: 0 1rem;
    }

    /* Cards */
    .brewery-card, .city-card {
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    /* Buttons - ensure touch targets */
    .btn-primary, .btn-secondary, .filter-chip, .filter-btn, .maps-link {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ============================================
   CROWD SOURCE SECTION
   ============================================ */
.crowd-source-section {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.crowd-source-prompt {
    background: rgba(245, 166, 35, 0.05);
    border: 1px solid rgba(245, 166, 35, 0.2);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
}

.crowd-source-prompt h3 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.crowd-source-prompt p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.hidden { display: none; }
.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;
}
