:root {
    --navy: #1B2A4E;
    --white: #FFFFFF;
    --green: #169B62;
    --light-gray: #F5F7FA;
    --shadow: 0 4px 20px rgba(27, 42, 78, 0.15);
    --radius: 8px;
}

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

body {
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    background: var(--light-gray);
    color: var(--navy);
    min-height: 100vh;
}

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

/* Header Styles */
.app-header {
    background: var(--navy);
    color: var(--white);
    padding: 1rem 1.5rem;
    position: relative;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-icon {
    font-size: 1.75rem;
    animation: bounce 2s infinite;
}

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

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-tagline {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: 0.25rem;
    margin-left: 2.75rem;
}

.header-accent {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--green) 0%, var(--white) 50%, #FF883E 100%);
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    min-height: 60vh;
}

.map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Legend */
.legend-container {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.legend-toggle {
    padding: 0.75rem 1rem;
    background: var(--navy);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    width: 100%;
    text-align: left;
}

.legend-content {
    padding: 0.75rem;
    max-height: 250px;
    overflow-y: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.8rem;
}

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-icon {
    font-size: 1rem;
}

.legend-label {
    color: var(--navy);
}

.center-btn {
    margin: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.center-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 155, 98, 0.4);
}

/* Stats Panel */
.stats-panel {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.stats-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--navy);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    border-radius: var(--radius);
}

.stats-panel.open .stats-toggle {
    border-radius: var(--radius) var(--radius) 0 0;
}

.stats-badge {
    background: var(--green);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.stats-content {
    padding: 1rem;
    max-width: 280px;
}

.stats-content h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--navy);
}

.stats-total {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--light-gray);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}

.stats-count {
    font-weight: 700;
    color: var(--green);
}

.stats-breakdown {
    margin-bottom: 1rem;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--light-gray);
}

.stats-item-count {
    font-weight: 600;
    color: var(--navy);
}

.stats-recent h4 {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--navy);
}

.recent-item {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
    padding: 0.25rem 0;
    align-items: center;
}

.recent-days {
    margin-left: auto;
    color: #888;
    font-size: 0.7rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(27, 42, 78, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--white);
    border-radius: calc(var(--radius) * 2);
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(27, 42, 78, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

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

.modal-header {
    background: var(--navy);
    color: var(--white);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.75rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    line-height: 1;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

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

.form-select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    color: var(--navy);
    cursor: pointer;
    transition: border-color 0.2s;
    background: var(--white);
}

.form-select:focus {
    outline: none;
    border-color: var(--green);
}

.form-textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--green);
}

.form-input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--green);
}

.form-section-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0 1rem;
    gap: 1rem;
}

.form-section-divider::before,
.form-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E2E8F0;
}

.form-section-divider span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.char-count {
    text-align: right;
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
}

.photo-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--light-gray);
    border: 2px dashed #CBD5E0;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--navy);
    transition: all 0.2s;
}

.photo-upload-btn:hover {
    border-color: var(--green);
    background: #E8F5EE;
}

.photo-preview {
    margin-top: 0.75rem;
    position: relative;
    display: inline-block;
}

.photo-preview img {
    max-width: 150px;
    max-height: 100px;
    border-radius: var(--radius);
    object-fit: cover;
    box-shadow: var(--shadow);
}

.remove-photo {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #EF4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Confirmation Step */
.confirmation-step {
    text-align: center;
    padding: 2rem 1.5rem;
}

.confirm-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.confirm-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.confirm-text {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.confirm-email {
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 1.5rem;
}

.confirm-code-display {
    background: linear-gradient(135deg, #E8F5EE 0%, #D4EDDA 100%);
    border: 2px dashed var(--green);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.confirm-label {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.confirm-code {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--green);
    letter-spacing: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.confirm-note {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
    margin-bottom: 1.5rem;
}

.confirm-input {
    text-align: center;
    font-size: 1.25rem;
    letter-spacing: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.form-error {
    background: #FEE2E2;
    color: #DC2626;
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: var(--light-gray);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-cancel {
    padding: 0.75rem 1.5rem;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-cancel:hover {
    transform: translateY(-2px);
}

.btn-submit {
    padding: 0.75rem 1.5rem;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 155, 98, 0.4);
}

/* Custom Markers */
.custom-marker {
    background: none;
    border: none;
}

.marker-pin {
    width: 36px;
    height: 44px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: dropIn 0.4s ease;
}

@keyframes dropIn {
    from { transform: rotate(-45deg) translateY(-20px); opacity: 0; }
    to { transform: rotate(-45deg) translateY(0); opacity: 1; }
}

.marker-icon {
    transform: rotate(45deg);
    font-size: 1rem;
}

/* Leaflet Popup Custom Styles */
.custom-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.custom-popup .leaflet-popup-content {
    margin: 0;
}

.popup-header-leaf {
    padding: 0.75rem 1rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.popup-body-leaf {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--navy);
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--green);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(22, 155, 98, 0.4);
    z-index: 3000;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    font-weight: 600;
}

@keyframes toastIn {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(-50%) translateY(0); opacity: 1; }
    to { transform: translateX(-50%) translateY(20px); opacity: 0; }
}

/* Help Tooltip */
.help-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(27, 42, 78, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.help-content {
    background: var(--white);
    padding: 2rem;
    border-radius: calc(var(--radius) * 2);
    max-width: 320px;
    position: relative;
    animation: slideUp 0.3s ease;
}

.help-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.help-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--navy);
}

.help-content p {
    margin-bottom: 1rem;
    color: #555;
    line-height: 1.5;
}

.help-content ul {
    list-style: none;
    margin-bottom: 1rem;
}

.help-content li {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--navy);
}

.help-note {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

.help-got-it {
    width: 100%;
    padding: 0.875rem;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
}

/* Footer */
.app-footer {
    background: #E2E8F0;
    padding: 1rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.8rem;
    color: var(--navy);
}

.footer-content p {
    margin-bottom: 0.25rem;
}

.footer-content a {
    color: var(--green);
    text-decoration: none;
    font-weight: 600;
}

.footer-content a:hover {
    text-decoration: underline;
}

.footer-disclaimer {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: #666;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .header-title h1 {
        font-size: 1.25rem;
    }
    
    .header-tagline {
        font-size: 0.75rem;
        margin-left: 2.25rem;
    }
    
    .legend-container {
        max-width: 200px;
    }
    
    .stats-panel {
        right: 0.5rem;
    }
    
    .stats-content {
        max-width: 220px;
    }
    
    .modal-content {
        margin: 0.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn-cancel, .btn-submit {
        width: 100%;
    }
}