/* Veteran Business Directory - Modern Design */

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

:root {
    /* Brand Colors */
    --gold: #d4af37;
    --gold-dark: #c9a227;
    --gold-darker: #b8860b;

    /* Background Colors */
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --text-dark: #4a5568;
    --dark-gray: #4a5568;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.08);

    /* Status Colors */
    --success: #48bb78;
    --error: #fc8181;
    --warning: #f6ad55;
    --info: #4299e1;

    /* Effects */
    --gold-glow: rgba(212, 175, 55, 0.3);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --box-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background Stars */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 230px 80px, rgba(255,255,255,0.2), transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.25), transparent);
    background-size: 400px 400px;
    animation: twinkle 8s ease-in-out infinite;
    z-index: 0;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.header {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(15, 52, 96, 0.9) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 100;
}

.header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold) 0%, #f4d03f 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header p {
    margin: 0.5rem 0 0 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Search Container */
.search-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    margin: 2rem auto;
    max-width: 700px;
    position: relative;
    z-index: 10;
}

.search-container h2 {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.search-container .text-muted {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--glass-hover);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

select.form-control {
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px var(--gold-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--gold-glow);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--dark-gray) 0%, #2d3748 100%);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4a5568 0%, #374151 100%);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #38a169 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    color: white;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-lg {
    padding: 1.125rem 2.5rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(15, 52, 96, 0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    border-bottom: 1px solid var(--glass-border);
}

.navbar-brand {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    position: absolute;
    left: 2rem;
    background: linear-gradient(135deg, var(--gold) 0%, #f4d03f 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--gold);
    background-color: var(--glass-bg);
}

.navbar-toggler {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    position: absolute;
    right: 2rem;
}

/* Business Cards */
.business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin: 2rem auto;
    max-width: 1400px;
    padding: 0 2rem;
}

.business-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.business-card:hover {
    transform: translateY(-5px);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    background: var(--glass-hover);
}

.business-logo {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.business-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.business-logo.placeholder {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--bg-primary);
    font-size: 3.5rem;
    font-weight: 800;
}

.business-info {
    padding: 1.5rem;
}

.business-name {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    text-align: center;
}

.business-category {
    text-align: center;
    color: var(--gold);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding: 0.35rem 0.75rem;
    background-color: rgba(212, 175, 55, 0.15);
    border-radius: 20px;
    display: inline-block;
    width: 100%;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.business-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.business-details p {
    margin: 0.5rem 0;
}

.business-details a {
    color: var(--gold);
    text-decoration: none;
    transition: var(--transition);
}

.business-details a:hover {
    color: var(--gold-dark);
    text-decoration: underline;
}

.business-distance {
    font-weight: 600;
    color: var(--success);
}

.service-types {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
}

.service-types strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.85rem;
}

/* Filter Section */
.filter-section {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    margin: 2rem auto;
    max-width: 1400px;
}

.filter-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.radius-value {
    font-weight: 700;
    color: var(--gold);
}

/* Map */
#map-container {
    margin: 2rem auto;
    max-width: 1400px;
    padding: 0 2rem;
}

#map {
    height: 450px;
    width: 100%;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--box-shadow);
}

/* Alert Messages */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border: 1px solid;
    backdrop-filter: blur(10px);
}

.alert-success {
    background-color: rgba(72, 187, 120, 0.15);
    border-color: rgba(72, 187, 120, 0.3);
    color: var(--success);
}

.alert-error {
    background-color: rgba(252, 129, 129, 0.15);
    border-color: rgba(252, 129, 129, 0.3);
    color: var(--error);
}

.alert-info {
    background-color: rgba(66, 153, 225, 0.15);
    border-color: rgba(66, 153, 225, 0.3);
    color: var(--info);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--glass-border);
    margin: auto;
    padding: 0;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 650px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.close {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
    transition: var(--transition);
}

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

/* Cards */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.card-body {
    padding: 2rem;
}

/* Loading */
.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--glass-border);
    border-radius: 50%;
    border-top-color: var(--gold);
    animation: spin 1s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

.checkbox-label:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.checkbox-label input {
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: rgba(212, 175, 55, 0.15);
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gold);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--glass-hover);
}

/* Mobile Styles */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .search-container,
    .form-container {
        padding: 1.5rem;
        margin: 1rem;
    }

    .business-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }

    .filter-controls {
        grid-template-columns: 1fr;
    }

    .filter-section {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 100;
        max-height: 80vh;
        overflow-y: auto;
    }

    .filter-section.show {
        transform: translateY(0);
    }

    .filter-toggle {
        position: fixed;
        bottom: 1rem;
        right: 1rem;
        z-index: 99;
        box-shadow: 0 4px 20px var(--gold-glow);
    }

    #map {
        height: 300px;
    }

    .navbar {
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 1rem 1.5rem;
    }

    .navbar-brand {
        position: static;
        left: auto;
        font-size: 1.25rem;
    }

    .navbar-toggler {
        display: block;
        position: static;
        right: auto;
    }

    .navbar-nav {
        flex-direction: column;
        width: 100%;
        display: none;
        padding-top: 1rem;
        gap: 0.5rem;
        background-color: var(--glass-bg);
        border-radius: var(--border-radius);
        padding: 1rem;
        margin-top: 1rem;
    }

    .navbar-nav.show {
        display: flex;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 0.875rem;
    }

    .checkbox-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .container {
        padding: 0 1rem;
    }
}

/* Form Container */
.form-container {
    max-width: 550px;
    margin: 2rem auto;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
}

/* Contribution Options */
.contribution-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.contribution-option {
    padding: 1.25rem;
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    background: var(--glass-bg);
}

.contribution-option:hover {
    border-color: rgba(212, 175, 55, 0.5);
    background: var(--glass-hover);
}

.contribution-option.selected {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}

/* Honeypot */
.honeypot {
    position: absolute;
    left: -9999px;
}

/* ALTCHA Widget */
.altcha-widget {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    background-color: var(--glass-bg);
    text-align: center;
    color: var(--text-secondary);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.bg-success {
    background-color: rgba(72, 187, 120, 0.2);
    color: var(--success);
}

.bg-secondary {
    background-color: var(--glass-bg);
    color: var(--text-secondary);
}

.bg-info {
    background-color: rgba(66, 153, 225, 0.2);
    color: var(--info);
}
