/*
NC Veteran Business Directory - iOS-Inspired Modern Design
Version: 2.0
Description: Premium 2025 iOS-style interface with fluid animations
Typography: SF Pro Display / Inter fallback
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* iOS-inspired color system */
    --ios-primary: #007AFF;
    --ios-secondary: #5856D6;
    --ios-success: #34C759;
    --ios-warning: #FF9500;
    --ios-danger: #FF3B30;

    /* NC Patriotic palette (updated with iOS vibrancy) */
    --nc-navy: #003366;
    --nc-navy-vibrant: #0047AB;
    --nc-blue: #7BAFD4;
    --nc-blue-vibrant: #56CCF2;
    --nc-red: #C8102E;
    --nc-red-vibrant: #FF3B30;
    --nc-gold: #FFB81C;
    --nc-gold-vibrant: #FFD60A;

    /* Surface colors */
    --surface-primary: #FFFFFF;
    --surface-secondary: #F2F2F7;
    --surface-tertiary: #E5E5EA;
    --surface-glass: rgba(255, 255, 255, 0.72);
    --surface-glass-dark: rgba(0, 0, 0, 0.32);

    /* Text colors */
    --text-primary: #000000;
    --text-secondary: #3C3C43;
    --text-tertiary: #8E8E93;
    --text-quaternary: #C7C7CC;

    /* Shadows (iOS-style layered) */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15);

    /* Border radius (iOS-style rounded) */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;

    /* Spacing scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Transitions (iOS-style easing) */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --surface-primary: #000000;
        --surface-secondary: #1C1C1E;
        --surface-tertiary: #2C2C2E;
        --surface-glass: rgba(28, 28, 30, 0.72);
        --text-primary: #FFFFFF;
        --text-secondary: #EBEBF5;
        --text-tertiary: #8E8E93;
    }
}

/* Base typography - iOS San Francisco style */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', sans-serif;
    font-size: 17px;
    line-height: 1.47;
    font-weight: 400;
    color: var(--text-primary);
    background-color: var(--surface-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

h1 { font-size: 34px; line-height: 1.12; font-weight: 800; }
h2 { font-size: 28px; line-height: 1.14; font-weight: 700; }
h3 { font-size: 22px; line-height: 1.18; font-weight: 600; }
h4 { font-size: 20px; line-height: 1.2; font-weight: 600; }

/* iOS-style glassmorphism card */
.ios-card {
    background: var(--surface-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-smooth);
    overflow: hidden;
}

.ios-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-2xl);
}

.ios-card-solid {
    background: var(--surface-primary);
    border-radius: var(--radius-2xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-smooth);
}

/* Business detail hero - iPhone-optimized */
.business-hero {
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    margin: var(--space-md);
    background: linear-gradient(135deg, var(--nc-navy-vibrant) 0%, var(--nc-blue-vibrant) 100%);
    box-shadow: var(--shadow-xl);
}

.business-hero-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.business-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-xl);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    color: white;
}

.business-hero-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-sm);
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.business-hero-subtitle {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* iOS-style badge */
.ios-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.badge-featured {
    background: linear-gradient(135deg, var(--nc-gold-vibrant) 0%, #FFAA00 100%);
    color: var(--nc-navy);
    box-shadow: 0 4px 12px rgba(255, 214, 10, 0.4);
}

.badge-verified {
    background: rgba(52, 199, 89, 0.2);
    color: var(--ios-success);
    border: 1.5px solid var(--ios-success);
}

.badge-veteran {
    background: linear-gradient(135deg, var(--nc-navy-vibrant) 0%, var(--nc-blue-vibrant) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 71, 171, 0.3);
}

/* Floating action button - iOS style */
.fab-ios {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--nc-red-vibrant) 0%, #FF6347 100%);
    color: white;
    border: none;
    box-shadow: 0 8px 24px rgba(255, 59, 48, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all var(--transition-bounce);
    z-index: 1000;
}

.fab-ios:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 32px rgba(255, 59, 48, 0.5);
}

.fab-ios:active {
    transform: scale(0.95);
}

/* iOS-style button */
.btn-ios {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px 24px;
    border-radius: var(--radius-full);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn-ios-primary {
    background: linear-gradient(135deg, var(--nc-navy-vibrant) 0%, var(--nc-blue-vibrant) 100%);
    color: white;
}

.btn-ios-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-ios-primary:active {
    transform: translateY(0);
}

.btn-ios-secondary {
    background: var(--surface-tertiary);
    color: var(--text-primary);
}

.btn-ios-outline {
    background: transparent;
    color: var(--nc-navy-vibrant);
    border: 2px solid var(--nc-navy-vibrant);
}

/* Info section - iOS card style */
.info-section {
    background: var(--surface-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    margin: var(--space-md);
    box-shadow: var(--shadow-md);
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--surface-tertiary);
}

.info-row:last-child {
    border-bottom: none;
}

.info-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--nc-blue-vibrant) 0%, var(--ios-primary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.info-content {
    flex: 1;
}

.info-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.info-value {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Rating stars - iOS style */
.ios-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 20px;
}

.ios-rating .fa-star {
    color: var(--nc-gold-vibrant);
    filter: drop-shadow(0 1px 2px rgba(255, 214, 10, 0.3));
}

.rating-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: var(--space-sm);
}

.rating-count {
    font-size: 15px;
    color: var(--text-tertiary);
    margin-left: var(--space-xs);
}

/* Image gallery - iOS Photos style */
.ios-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-sm);
    margin: var(--space-md);
}

.ios-gallery-item {
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.ios-gallery-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.ios-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Bottom navigation - iOS style */
.ios-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 999;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

.ios-bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.ios-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
}

.ios-bottom-nav-item.active {
    color: var(--nc-navy-vibrant);
}

.ios-bottom-nav-item:hover {
    background: var(--surface-tertiary);
}

.ios-bottom-nav-icon {
    font-size: 24px;
}

.ios-bottom-nav-label {
    font-size: 11px;
    font-weight: 600;
}

/* Sticky header - iOS style */
.ios-sticky-header {
    position: sticky;
    top: 0;
    background: var(--surface-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 16px;
    z-index: 998;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    transition: all var(--transition-base);
}

.ios-sticky-header.scrolled {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* iOS-style loading spinner */
.ios-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--surface-tertiary);
    border-top-color: var(--nc-navy-vibrant);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

/* Responsive optimizations for iPhone */
@media (max-width: 428px) {
    h1 { font-size: 28px; }
    h2 { font-size: 24px; }
    h3 { font-size: 20px; }

    .business-hero {
        margin: var(--space-sm);
        border-radius: var(--radius-xl);
    }

    .business-hero-image {
        height: 220px;
    }

    .business-hero-overlay {
        padding: var(--space-lg);
    }

    .ios-card {
        padding: var(--space-md);
        border-radius: var(--radius-xl);
    }

    .info-section {
        margin: var(--space-sm);
        padding: var(--space-md);
    }
}

/* Handle notch on iPhone */
@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .ios-sticky-header {
        padding-top: max(16px, env(safe-area-inset-top));
    }
}

/* Smooth transitions for route changes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp var(--transition-smooth) ease-out;
}

/* Pull-to-refresh indicator (visual only) */
.pull-refresh-indicator {
    height: 0;
    overflow: hidden;
    transition: height var(--transition-base);
}

.pulling .pull-refresh-indicator {
    height: 60px;
}
