/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --error-color: #ef4444;
    --success-color: #22c55e;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
    --transition: all 0.2s ease;
}

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

/* Base */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    font-size: 1.75rem;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--surface-light);
}

.nav-link.active {
    color: var(--primary-light);
    background: rgba(59, 130, 246, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Pages */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

/* Data View Page */
.view-container {
    text-align: center;
}

.address-selector {
    max-width: 600px;
    margin: 0 auto 3rem;
    position: relative;
}

.search-wrapper {
    position: relative;
}

.address-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    transition: var(--transition);
}

.address-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

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

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 50;
}

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

.suggestion-item {
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

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

.suggestion-item:hover {
    background: var(--surface-light);
}

.suggestion-item .address {
    font-weight: 500;
    color: var(--text-primary);
}

.suggestion-item .details {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Property Display - Hub and Spoke */
.property-display {
    padding: 2rem;
}

.property-display.hidden {
    display: none;
}

.hub-spoke-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 700px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* SVG Connections Layer */
.connections-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.connection-line {
    stroke: var(--primary-color);
    stroke-width: 2;
    fill: none;
    opacity: 0.4;
    stroke-dasharray: 8 4;
    animation: dashFlow 1s linear infinite;
}

@keyframes dashFlow {
    to { stroke-dashoffset: -12; }
}

/* Central Hub Link Wrapper */
.central-hub-link {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    z-index: 10;
}

.central-hub-link:hover .central-hub {
    box-shadow: 0 0 70px rgba(37, 99, 235, 0.8), inset 0 0 40px rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Central Hub */
.central-hub {
    position: relative;
    width: 220px;
    height: 220px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 50px rgba(37, 99, 235, 0.5), inset 0 0 30px rgba(255, 255, 255, 0.1);
    animation: hubPulse 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

.central-hub::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid var(--primary-light);
    opacity: 0.3;
    animation: ringExpand 2s ease-out infinite;
}

@keyframes hubPulse {
    0%, 100% {
        box-shadow: 0 0 50px rgba(37, 99, 235, 0.5), inset 0 0 30px rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 70px rgba(37, 99, 235, 0.7), inset 0 0 40px rgba(255, 255, 255, 0.15);
        transform: scale(1.02);
    }
}

@keyframes ringExpand {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.3); opacity: 0; }
}

.hub-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.hub-address {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    padding: 0 1rem;
    color: var(--text-primary);
    line-height: 1.3;
    max-width: 180px;
}

/* Spoke Nodes */
.spoke-node {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    min-height: 140px;
    background: linear-gradient(145deg, var(--surface), var(--surface-light));
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    z-index: 5;
    overflow: hidden;
    animation: spokeAppear 0.6s ease-out backwards;
}

/* Staggered animation delays for each spoke */
.spoke-node.property-info { animation-delay: 0.1s; }
.spoke-node.primary-school { animation-delay: 0.2s; }
.spoke-node.secondary-school { animation-delay: 0.3s; }
.spoke-node.train-station { animation-delay: 0.4s; }
.spoke-node.flinders-train { animation-delay: 0.5s; }

@keyframes spokeAppear {
    from {
        opacity: 0;
        scale: 0.5;
    }
    to {
        opacity: 1;
        scale: 1;
    }
}

/* Connection line from spoke to hub */
.spoke-node::after {
    content: '';
    position: absolute;
    width: 2px;
    background: linear-gradient(180deg, var(--primary-color), transparent);
    opacity: 0.3;
    z-index: -1;
}

/* Specific line lengths and rotations for each spoke */
.spoke-node.primary-school::after {
    height: 150px;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.spoke-node.secondary-school::after {
    height: 150px;
    bottom: 70%;
    right: 70%;
    transform-origin: bottom right;
    transform: rotate(-60deg);
}

.spoke-node.train-station::after {
    height: 150px;
    top: 70%;
    right: 70%;
    transform-origin: top right;
    transform: rotate(-150deg);
}

.spoke-node.flinders-train::after {
    height: 150px;
    top: 70%;
    left: 70%;
    transform-origin: top left;
    transform: rotate(150deg);
}

.spoke-node.property-info::after {
    height: 150px;
    bottom: 70%;
    left: 70%;
    transform-origin: bottom left;
    transform: rotate(60deg);
}

/* Hover effect - shimmer */
.spoke-node::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.spoke-node:hover::before {
    left: 100%;
}

.spoke-node:hover::after {
    opacity: 0.6;
    background: linear-gradient(180deg, var(--primary-light), transparent);
}

.spoke-node:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3), 0 0 0 1px var(--primary-color);
    scale: 1.05;
}

.spoke-node .node-icon {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.spoke-node .node-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.375rem;
    font-weight: 600;
}

.spoke-node .node-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.spoke-node .node-detail {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    line-height: 1.3;
}

/* Node type specific colors */
.spoke-node.primary-school { border-left: 4px solid #f59e0b; }
.spoke-node.secondary-school { border-left: 4px solid #8b5cf6; }
.spoke-node.train-station { border-left: 4px solid #10b981; }
.spoke-node.flinders-train { border-left: 4px solid #06b6d4; }
.spoke-node.flinders-direct { border-left: 4px solid #ec4899; }
.spoke-node.property-info { border-left: 4px solid #3b82f6; }

/* Circular positioning for nodes - PERFECT PENTAGON layout */
/* 5 nodes evenly distributed in a circle at 72° intervals, radius 260px */

/* Primary School - 0° (top) */
.spoke-node.primary-school {
    transform: translate(-50%, -50%) !important;
    margin-left: 0px !important;
    margin-top: -260px !important;
}

/* Secondary School - 72° (upper-right) */
.spoke-node.secondary-school {
    transform: translate(-50%, -50%) !important;
    margin-left: 247px !important;
    margin-top: -80px !important;
}

/* Train Station - 144° (lower-right) */
.spoke-node.train-station {
    transform: translate(-50%, -50%) !important;
    margin-left: 153px !important;
    margin-top: 210px !important;
}

/* Flinders via Train - 216° (lower-left) */
.spoke-node.flinders-train {
    transform: translate(-50%, -50%) !important;
    margin-left: -153px !important;
    margin-top: 210px !important;
}

/* Property Info - 288° (upper-left) */
.spoke-node.property-info {
    transform: translate(-50%, -50%) !important;
    margin-left: -247px !important;
    margin-top: -80px !important;
}

/* Flinders Direct (if exists) - 6 o'clock (bottom) */
.spoke-node.flinders-direct {
    transform: translate(-50%, -50%) translate(0, 260px);
}

/* Lookup link in nodes */
.lookup-link {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.lookup-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* NAPLAN Scores in School Nodes */
.naplan-scores {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-color);
    background: rgba(245, 158, 11, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    margin: 0.25rem 0;
    cursor: help;
}

.naplan-scores:hover {
    background: rgba(245, 158, 11, 0.25);
}

/* NAPLAN Quality Indicators */
.naplan-scores.quality-good {
    color: var(--success-color);
    background: rgba(34, 197, 94, 0.15);
}

.naplan-scores.quality-good:hover {
    background: rgba(34, 197, 94, 0.25);
}

.naplan-scores.quality-ok {
    color: var(--accent-color);
    background: rgba(245, 158, 11, 0.15);
}

.naplan-scores.quality-low {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.15);
}

.naplan-scores.quality-low:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* Entry Tabs */
.entry-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--surface-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    line-height: 1.5;
}

.html-input {
    width: 100%;
    min-height: 150px;
    background: var(--surface-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.75rem;
    color: var(--text-primary);
    resize: vertical;
    transition: var(--transition);
}

.html-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* No Selection Placeholder */
.no-selection {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.loading::before {
    content: '';
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

/* Error State */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
}

.error-message h3 {
    color: var(--error-color);
    margin-bottom: 0.5rem;
}

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

.code-block {
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin: 0.75rem 0;
    display: inline-block;
}

/* JSON Output for Copy */
.json-output {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.75rem;
    color: var(--text-primary);
    resize: vertical;
    margin: 1rem 0;
}

.copy-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.copy-btn:hover {
    background: #059669;
    transform: translateY(-2px);
}

.success-message {
    text-align: left;
}

.success-message h3 {
    color: var(--success-color);
    margin-bottom: 0.5rem;
}

.success-message code {
    background: var(--surface-light);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

/* Data Entry Page */
.entry-container {
    max-width: 600px;
    margin: 0 auto;
}

.entry-form {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.url-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    background: var(--surface-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: var(--transition);
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-loader.hidden {
    display: none;
}

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

/* Scrape Result */
.scrape-result {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.scrape-result.hidden {
    display: none;
}

.scrape-result.success {
    border: 1px solid var(--success-color);
}

.scrape-result.error {
    border: 1px solid var(--error-color);
}

/* Database Preview */
.database-preview h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.database-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.database-item {
    background: var(--surface);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
}

.database-item .item-address {
    font-weight: 500;
}

.database-item .item-price {
    color: var(--secondary-color);
    font-weight: 600;
}

/* Footer */
.footer {
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

/* Localhost Only Elements */
.localhost-only {
    display: none;
}

body.is-localhost .localhost-only {
    display: block;
}

body.is-localhost .nav-link.localhost-only {
    display: inline-block;
}

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

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, var(--surface-light) 25%, var(--surface) 50%, var(--surface-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

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

    .main-content {
        padding: 1rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .hub-spoke-container {
        height: 550px;
        padding: 0;
    }

    .central-hub {
        width: 140px;
        height: 140px;
    }

    .hub-icon {
        font-size: 2.2rem;
    }

    .hub-address {
        font-size: 0.65rem;
        max-width: 120px;
    }

    .spoke-node {
        width: 110px;
        min-height: 100px;
        padding: 0.65rem;
    }

    .spoke-node .node-icon {
        font-size: 1.6rem;
    }

    .spoke-node .node-title {
        font-size: 0.55rem;
    }

    .spoke-node .node-value {
        font-size: 0.7rem;
    }

    .spoke-node .node-detail {
        font-size: 0.6rem;
    }

    /* Mobile pentagon layout - radius 180px, same margin-based approach */
    .spoke-node.primary-school {
        transform: translate(-50%, -50%) !important;
        margin-left: 0px !important;
        margin-top: -180px !important;
    }

    .spoke-node.secondary-school {
        transform: translate(-50%, -50%) !important;
        margin-left: 171px !important;
        margin-top: -55px !important;
    }

    .spoke-node.train-station {
        transform: translate(-50%, -50%) !important;
        margin-left: 106px !important;
        margin-top: 146px !important;
    }

    .spoke-node.flinders-train {
        transform: translate(-50%, -50%) !important;
        margin-left: -106px !important;
        margin-top: 146px !important;
    }

    .spoke-node.property-info {
        transform: translate(-50%, -50%) !important;
        margin-left: -171px !important;
        margin-top: -55px !important;
    }

    .spoke-node.flinders-direct {
        transform: translate(-50%, -50%) !important;
        margin-left: 0 !important;
        margin-top: 180px !important;
    }

    /* Shorter connection lines for mobile */
    .spoke-node.primary-school::after,
    .spoke-node.secondary-school::after,
    .spoke-node.train-station::after,
    .spoke-node.flinders-train::after,
    .spoke-node.property-info::after {
        height: 110px;
    }
}

/* ==========================================
   Data Comparison Page Styles
   ========================================== */

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

/* Property Selector Section */
.property-selector-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.property-selector-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

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

.property-checkbox {
    background: var(--background);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.property-checkbox:hover {
    border-color: var(--primary-light);
    background: var(--surface-light);
}

.property-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.property-checkbox input[type="checkbox"]:checked ~ label {
    color: var(--primary-light);
}

.property-checkbox input[type="checkbox"]:checked ~ label .property-address {
    color: var(--primary-light);
}

.property-checkbox:has(input[type="checkbox"]:checked) {
    border-color: var(--primary-light);
    background: var(--surface-light);
}

.property-checkbox input[type="checkbox"]:checked ~ * {
    opacity: 1;
}

.property-label {
    cursor: pointer;
    user-select: none;
    display: block;
}

.property-address {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.property-checkbox input[type="checkbox"]:checked + label .property-address {
    color: var(--primary-light);
}

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

.selection-count {
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--background);
    border-radius: var(--radius-md);
}

/* Comparison Chart Section */
.comparison-chart-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.comparison-chart-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.chart-wrapper {
    background: var(--background);
    padding: 2rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-wrapper canvas {
    max-width: 100%;
    width: 100% !important;
    height: 100% !important;
}

/* Legend */
.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--background);
    border-radius: var(--radius-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex: 1;
}

/* Metrics Table */
.metrics-table-wrapper {
    margin-top: 2rem;
}

.metrics-table-wrapper h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.metrics-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--background);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.metrics-table thead {
    background: var(--surface-light);
}

.metrics-table th,
.metrics-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.metrics-table th {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metrics-table td {
    color: var(--text-secondary);
}

.metrics-table td.metric-label {
    font-weight: 500;
    color: var(--text-primary);
}

.metrics-table tbody tr:last-child td {
    border-bottom: none;
}

.metrics-table tbody tr:hover {
    background: var(--surface-light);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
    background: var(--background);
    border-radius: var(--radius-md);
}

/* Metrics Loading State */
.metrics-loader {
    text-align: center;
    padding: 2rem;
    background: var(--background);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.metrics-loader .loading {
    padding: 2rem;
    font-size: 1rem;
    color: var(--primary-light);
}

/* Responsive Design for Comparison Page */
@media (max-width: 768px) {
    .compare-container {
        padding: 1rem;
    }

    .property-selector {
        grid-template-columns: 1fr;
    }

    .chart-wrapper {
        padding: 1rem;
        height: 450px;
    }

    .metrics-table {
        font-size: 0.875rem;
    }

    .metrics-table th,
    .metrics-table td {
        padding: 0.75rem 0.5rem;
    }

    .chart-legend {
        flex-direction: column;
    }
}
