/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --border-radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5em;
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

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

a:hover {
    text-decoration: underline;
}

/* Header */
.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo:hover {
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

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

.btn-large {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.alert ul {
    margin-left: 1.5rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* Search */
.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.search-box .btn {
    padding: 1rem 2rem;
}

.inline-search {
    margin-bottom: 2rem;
}

.inline-search .search-box input {
    border: 1px solid var(--border-color);
}

/* States Grid */
.states-section {
    padding: 3rem 0;
}

.states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    transition: box-shadow 0.2s;
}

.state-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.state-abbrev {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.state-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* FFL List */
.ffl-page-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.ffl-sidebar {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    height: fit-content;
}

.ffl-sidebar h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.state-list, .city-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.state-list li, .city-list li {
    padding: 0.25rem 0;
    display: flex;
    justify-content: space-between;
}

.state-list .count, .city-list .count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.ffl-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ffl-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.ffl-card h3 {
    margin-bottom: 0.5rem;
}

.ffl-address {
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.ffl-phone {
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.ffl-type {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* FFL Detail */
.ffl-detail {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.ffl-map-container {
    border-bottom: 1px solid var(--border-color);
}

#ffl-map {
    height: 300px;
    width: 100%;
    z-index: 1;
}

.ffl-header {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid var(--border-color);
}

.ffl-logo {
    max-width: 150px;
    max-height: 100px;
    object-fit: contain;
}

.ffl-type-badge {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.ffl-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    padding: 2rem;
}

.ffl-content.ffl-content-unclaimed {
    display: block;
    padding: 0;
}

.ffl-section {
    margin-bottom: 1.5rem;
}

.ffl-section h2 {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ffl-sidebar-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-card {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: var(--border-radius);
}

.info-card h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.info-item {
    margin-bottom: 0.75rem;
}

.info-item strong {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* FFL Unclaimed Layout */
.ffl-unclaimed-layout {
    padding: 2rem;
}

.ffl-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ffl-info-cards .info-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.ffl-info-cards .info-card h3 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* License Status */
.status-active {
    color: var(--success-color);
    font-weight: 600;
}

.status-expired {
    color: var(--danger-color);
    font-weight: 600;
}

.status-unknown {
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
}

.page-link:hover {
    background: var(--bg-color);
    text-decoration: none;
}

.page-link.current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Breadcrumb */
.breadcrumb {
    padding: 1rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--text-muted);
}

/* Blog */
.blog-section {
    padding: 3rem 0;
    background: var(--card-bg);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1rem 0;
}

.blog-card {
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: var(--border-radius);
}

.blog-card h3 {
    margin-bottom: 0.5rem;
}

.blog-card time {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-card-large {
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.blog-card-large h2 {
    margin-bottom: 0.5rem;
}

.blog-excerpt {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.blog-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.blog-post {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 2rem;
}

.blog-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.blog-content {
    line-height: 1.8;
}

.blog-content h2 {
    margin-top: 2rem;
}

.blog-content p {
    margin-bottom: 1rem;
}

.blog-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* CTA Section */
.cta-section {
    padding: 4rem 0;
    text-align: center;
    background: var(--bg-color);
}

.cta-section h2 {
    margin-bottom: 0.5rem;
}

.cta-section p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.section-footer {
    text-align: center;
    margin-top: 1rem;
}

/* Auth Pages */
.auth-page {
    display: flex;
    justify-content: center;
    padding: 4rem 0;
}

.auth-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.register-card {
    max-width: 500px;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-page h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-page p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header p {
    color: var(--text-muted);
}

/* Footer */
.site-footer {
    background: var(--text-color);
    color: white;
    padding: 3rem 0;
    margin-top: 4rem;
}

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

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.footer-legal {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.5);
}

.footer-legal a:hover {
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .search-box {
        flex-direction: column;
    }

    .ffl-page-layout {
        grid-template-columns: 1fr;
    }

    .ffl-content {
        grid-template-columns: 1fr;
    }

    .ffl-header {
        flex-direction: column;
        text-align: center;
    }
}

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

.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Autocomplete Dropdown */
.search-autocomplete {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    margin-top: 4px;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background-color: #f1f5f9;
}

.autocomplete-item-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 2px;
}

.autocomplete-item-location {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.autocomplete-no-results {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
}

.autocomplete-loading {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
}

/* Claim Listing CTA */
.claim-listing-cta {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid #0ea5e9;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    margin-top: 1rem;
}

.claim-listing-cta .cta-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.claim-listing-cta h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.claim-listing-cta > p {
    color: var(--text-color);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.cta-benefits {
    list-style: none;
    text-align: left;
    max-width: 350px;
    margin: 0 auto 1.5rem;
    padding: 0;
}

.cta-benefits li {
    padding: 0.5rem 0;
    padding-left: 1.75rem;
    position: relative;
    color: var(--text-color);
}

.cta-benefits li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.claim-listing-cta .btn {
    font-size: 1.1rem;
    padding: 0.875rem 2.5rem;
}

/* Static Pages (About, Privacy, Terms) */
.static-page {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 2rem 3rem;
    margin: 2rem 0;
    max-width: 900px;
}

.static-page h1 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.static-page .last-updated {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.static-page .page-section {
    margin-bottom: 2rem;
}

.static-page .page-section:last-child {
    margin-bottom: 0;
}

.static-page h2 {
    color: var(--text-color);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.static-page h3 {
    color: var(--text-color);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.static-page p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.static-page ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.static-page li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.static-page .contact-info {
    background: var(--bg-color);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .static-page {
        padding: 1.5rem;
    }
}

/* Blog Keyword Tags */
.blog-keywords {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.keywords-label {
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.keyword-tag {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.keyword-tag:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}
