/* Main stylesheet for Vancouver CBC Registration */

/* CSS Custom Properties for Map Colors */
:root {
    --map-color-low: #f58231;   /* Orange - 0-3 registered */
    --map-color-med: #800000;   /* Maroon - 4-8 registered */
    --map-color-high: #000075;  /* Navy - 8+ registered */
    --map-color-selected: #ffe119; /* Yellow - selected area */
}

/* Map styling */
#count-area-map {
    width: 100%;
    height: 400px;
    border: 2px solid #dee2e6;
    border-radius: 0.375rem;
}

/* Area polygon styles for different registration counts */
.area-polygon-low-count {
    fill-opacity: 0.3;
    stroke-width: 2;
    stroke: var(--map-color-low);
    fill: var(--map-color-low);
}

.area-polygon-med-count {
    fill-opacity: 0.3;
    stroke-width: 2;
    stroke: var(--map-color-med);
    fill: var(--map-color-med);
}

.area-polygon-high-count {
    fill-opacity: 0.3;
    stroke-width: 2;
    stroke: var(--map-color-high);
    fill: var(--map-color-high);
}

.area-polygon-selected {
    fill-opacity: 0.6;
    stroke-width: 4;
    stroke: var(--map-color-selected);
    fill: var(--map-color-selected);
}

/* Form styling */
.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Notes field placeholder styling - make example text more distinct */
#notes_to_organizers::placeholder {
    font-style: italic;
    color: #9ca3af;
    opacity: 1;
}

/* Map legend */
.map-legend {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.legend-item {
    margin-right: 1rem;
}

.color-box {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 0.25rem;
    border-radius: 2px;
}

.color-box.low-count {
    background-color: var(--map-color-low);
}

.color-box.med-count {
    background-color: var(--map-color-med);
}

.color-box.high-count {
    background-color: var(--map-color-high);
}

/* Selection feedback */
.selection-feedback {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 0.375rem;
    font-weight: 500;
    color: #004085;
}

.selection-feedback.area-selected {
    background-color: #d1edff;
    border-color: #86cfff;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #count-area-map {
        height: 300px;
        margin-bottom: 1rem;
    }

    .form-control,
    .form-select {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1.1rem;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Alert customizations */
.alert-success {
    border-left: 4px solid #28a745;
}

.alert-danger {
    border-left: 4px solid #dc3545;
}

/* Navbar brand styling */
.navbar-brand {
    font-weight: 600;
}

/* Card enhancements */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Button styling */
.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Form validation styles */
.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: block;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    #count-area-map {
        display: none !important;
    }

    .container {
        max-width: none !important;
    }
}