:root {
    --primary-color: #dc2626;
    --primary-dark: #991b1b;
    --primary-light: #ef4444;
    --secondary-color: #f59e0b;
    --background: #0a0a0a;
    --surface: #1a1a1a;
    --surface-light: #262626;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;
    --border-color: #333333;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

.app-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(26, 26, 26, 0.95);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

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

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

.app-title h1 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.menu-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

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

.about-button {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.about-button:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

.action-button.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-button.secondary {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.action-button.secondary:hover {
    background: var(--border-color);
}

.action-button.full-width {
    width: 100%;
}

.icon {
    width: 20px;
    height: 20px;
}

.filter-select-sm {
    padding: 0.375rem 0.5rem;
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 73px;
    position: relative;
}

.map-container {
    position: relative;
    height: 50vh;
    min-height: 300px;
    background: var(--surface);
}

.map {
    width: 100%;
    height: 100%;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent 70%, rgba(0, 0, 0, 0.4));
}

.incidents-panel {
    flex: 1;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-height: 40vh;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-light);
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.incident-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--surface);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.incidents-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.incident-card {
    background: var(--surface-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    display: flex;
    gap: 1rem;
}

.incident-card.has-photo {
    padding: 0.75rem;
}

.incident-card:hover {
    transform: translateX(4px);
    border-color: var(--primary-color);
}

.incident-card.selected {
    background: rgba(220, 38, 38, 0.1);
    border-color: var(--primary-color);
}

.incident-photo {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
}

.incident-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.incident-content {
    flex: 1;
    min-width: 0;
}

.incident-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.incident-name {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
}

.incident-meta {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.incident-badge {
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-weight: 500;
}

.incident-badge.fatal {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.incident-badge.survived {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.incident-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.incident-location-date {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.incident-location {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.incident-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.report-modal,
.detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    padding: 1rem;
    overflow-y: auto;
    backdrop-filter: blur(4px);
}

.report-modal.active,
.detail-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--surface-light);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    background: var(--primary-color);
}

.modal-title {
    padding: 1.5rem 1.5rem 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.report-steps-info {
    padding: 0 1.5rem;
    margin-bottom: 0.5rem;
}

.how-it-works {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.8;
}

.how-it-works li::marker {
    color: var(--text-muted);
}

.report-step {
    padding: 0 1.5rem 1.5rem;
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-light);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: var(--transition);
}

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

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

.step-line {
    width: 60px;
    height: 2px;
    background: var(--surface-light);
    transition: var(--transition);
}

.step-line.active {
    background: var(--success);
}

.step-instruction {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.map-picker {
    height: 300px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border-color);
    margin-bottom: 1rem;
}

.help-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

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

.help-text a:hover {
    text-decoration: underline;
}

.location-confirm-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.icon-sm {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.success-color {
    color: var(--success);
}

.confirm-inline-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--success);
}

.coords-inline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
    margin-left: auto;
}

.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.mobile-nav.active {
    display: block;
    transform: translateY(0);
}

.nav-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 0.5rem;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    transition: var(--transition);
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-color);
}

.detail-content {
    padding: 1.5rem;
}

.detail-header {
    margin-bottom: 1.5rem;
}

.detail-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.detail-description {
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.detail-photos {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.detail-photo {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.detail-photo img {
    width: 100%;
    height: auto;
    display: block;
}

.hidden {
    display: none !important;
}

@media (min-width: 768px) {
    .app-title h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.875rem;
    }
    
    .main-content {
        flex-direction: row;
        margin-top: 73px;
    }
    
    .action-button {
        flex: 0 0 auto;
    }

    .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        max-width: 1400px;
        margin: 0 auto;
        gap: 1rem;
    }
    
    .map-container {
        flex: 1.5;
        height: calc(100vh - 73px);
    }
    
    .incidents-panel {
        flex: 1;
        border-top: none;
        border-left: 1px solid var(--border-color);
        height: calc(100vh - 73px);
    }
    
    .mobile-nav {
        display: none !important;
    }
    
    .detail-photos {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .header-content {
        padding: 1.25rem 2rem;
    }
    
    .incidents-list {
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .incident-card {
        padding: 1.25rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .map-container {
        touch-action: none;
    }
    
    .incidents-list {
        -webkit-overflow-scrolling: touch;
    }
}