/* ===== Google Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap');

/* ===== CSS Variables - Xplorate Brand ===== */
:root {
    --primary-color: #2ea3f2;
    --primary-dark: #1a8fd9;
    --primary-light: #5bb8f5;
    --accent-dark: #32373c;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #ffffff;
    --border-color: #e2e2e2;
    --bg-overlay: rgba(255, 255, 255, 0.93);
    --bg-card: rgba(255, 255, 255, 0.97);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --border-radius: 10px;
    --border-radius-sm: 6px;
    --transition: all 0.25s ease;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: 'Open Sans', Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    background: url('/static/images/background.png') no-repeat center center fixed;
    background-size: cover;
}

/* ===== Background Overlay ===== */
.page-wrapper {
    min-height: 100vh;
    background: var(--bg-overlay);
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

/* ===== Header ===== */
.site-header {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1001;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.logo {
    height: 44px;
    width: auto;
    border-radius: var(--border-radius-sm);
}

.site-title {
    font-size: 2.3rem;
    font-weight: 600;
    color: var(--accent-dark);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(46, 163, 242, 0.1);
    color: var(--primary-dark);
}

.nav-link svg {
    width: 18px;
    height: 18px;
}

/* ===== Main Content ===== */
.main-content {
    max-width: 1080px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* ===== Page Header ===== */
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.page-header h1 {
    color: var(--accent-dark);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== States Grid ===== */
.states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}

/* ===== State Card ===== */
.state-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.state-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: var(--transition);
}

.state-card.active {
    cursor: pointer;
}

.state-card.active:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.state-card.active:hover::before {
    transform: scaleX(1);
}

.state-card.inactive {
    opacity: 0.55;
    cursor: not-allowed;
}

.state-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.state-code {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.state-card.active .state-code {
    color: var(--primary-color);
}

.state-card.inactive .state-code {
    color: var(--text-secondary);
}

.state-name {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.875rem;
}

.state-status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
}

.state-card.active .state-status {
    background: rgba(46, 163, 242, 0.12);
    color: var(--primary-color);
}

.state-card.inactive .state-status {
    background: rgba(102, 102, 102, 0.1);
    color: var(--text-secondary);
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(46, 163, 242, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

/* ===== Map Page Styles ===== */
.map-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: none;
}

.map-page .page-wrapper {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.map-header {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1001;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color);
}

.map-header .header-content {
    padding: 0.75rem 1.5rem;
}

.map-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.map-container {
    flex: 1;
    position: relative;
    width: 100%;
}

/* ===== Legend Bar ===== */
.legend-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.legend-bar .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-bar .legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-dark);
    color: var(--text-light);
}

.btn-primary:hover {
    background: #464c52;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--text-light);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-content {
        padding: 0.75rem 1rem;
    }

    .main-content {
        padding: 2rem 1rem;
    }

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

    .state-card {
        padding: 1.15rem;
    }

    .state-code {
        font-size: 1.85rem;
    }

    .legend-bar {
        gap: 1rem;
        flex-wrap: wrap;
        padding: 0.4rem 0.75rem;
    }

    .legend-bar .legend-item {
        font-size: 0.7rem;
    }

    .legend-bar .legend-color {
        width: 12px;
        height: 12px;
    }

    .map-title {
        font-size: 0.95rem;
    }

    .logo {
        height: 36px;
    }

    .site-title {
        font-size: 1rem;
    }
}