/* ========================================
   IGACOS Emergency Response System
   Mobile-First Responder Application
   ======================================== */

/* CSS Variables */
:root {
    /* Primary Colors */
    --primary: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #0f2440;

    /* Accent Colors */
    --accent: #3182ce;
    --accent-light: #4299e1;

    /* Status Colors */
    --success: #38a169;
    --warning: #d69e2e;
    --danger: #e53e3e;
    --info: #3182ce;

    /* Priority Colors */
    --critical: #e53e3e;
    --high: #dd6b20;
    --medium: #d69e2e;
    --low: #38a169;

    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --gray-900: #171923;

    /* Agency Colors */
    --pnp: #1a365d;
    --bfp: #c53030;
    --ems: #2f855a;
    --traffic: #b7791f;
    --mdrrmo: #6b46c1;
    --brgy: #2b6cb0;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Font */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: 1rem;
}

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

.screen {
    min-height: 100vh;
}

/* ========================================
   Splash Screen
   ======================================== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.splash-content {
    text-align: center;
    color: var(--white);
}

.splash-logo {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    animation: pulse 2s infinite;
}

.splash-logo i {
    font-size: 3rem;
}

.splash-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.splash-content p {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: var(--space-lg);
}

.splash-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* ========================================
   Login Screen
   ======================================== */
.login-screen {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
}

.login-header {
    text-align: center;
    color: var(--white);
    padding: var(--space-xl) 0;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
}

.login-logo i {
    font-size: 2.5rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.login-header p {
    font-size: 0.875rem;
    opacity: 0.8;
}

.login-form {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-xl);
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-xs);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

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

.btn-block {
    width: 100%;
}

.login-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    margin-top: auto;
    padding: var(--space-lg) 0;
}

/* ========================================
   App Header
   ======================================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-left, .header-right {
    width: 60px;
}

.header-center h1 {
    font-size: 1rem;
    font-weight: 600;
}

.agency-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    position: relative;
    transition: background var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: var(--white);
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Status Bar
   ======================================== */
.status-bar {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--white);
    padding: var(--space-sm) var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
    z-index: 99;
}

.responder-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.responder-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.responder-details {
    display: flex;
    flex-direction: column;
}

.responder-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
}

.responder-status {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.responder-status.online {
    color: var(--success);
}

.responder-status.offline {
    color: var(--gray-400);
}

.responder-status i {
    font-size: 0.5rem;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: var(--transition-fast);
    border-radius: var(--radius-full);
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: var(--white);
    transition: var(--transition-fast);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

input:checked + .slider {
    background-color: var(--success);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    padding-top: 120px;
    padding-bottom: 80px;
    min-height: 100vh;
}

.tab-content {
    display: none;
    padding: var(--space-md);
    animation: fadeIn var(--transition-normal);
}

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

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

.tab-header {
    margin-bottom: var(--space-md);
}

.tab-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.tab-header h2 i {
    color: var(--primary);
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: var(--space-sm);
}

.filter-btn {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-200);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

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

/* ========================================
   Incident List
   ======================================== */
.incident-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.incident-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--gray-300);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.incident-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.incident-card.critical {
    border-left-color: var(--critical);
}

.incident-card.high {
    border-left-color: var(--high);
}

.incident-card.medium {
    border-left-color: var(--medium);
}

.incident-card.low {
    border-left-color: var(--low);
}

.incident-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.incident-type {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.incident-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1rem;
}

.incident-icon.fire {
    background: var(--bfp);
}

.incident-icon.medical {
    background: var(--ems);
}

.incident-icon.crime {
    background: var(--pnp);
}

.incident-icon.traffic {
    background: var(--traffic);
}

.incident-icon.disaster {
    background: var(--mdrrmo);
}

.incident-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
}

.incident-id {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.priority-badge {
    padding: 2px 8px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--radius-full);
    color: var(--white);
}

.priority-badge.critical {
    background: var(--critical);
}

.priority-badge.high {
    background: var(--high);
}

.priority-badge.medium {
    background: var(--medium);
}

.priority-badge.low {
    background: var(--low);
}

.incident-location {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-bottom: var(--space-sm);
}

.incident-location i {
    color: var(--danger);
    font-size: 0.75rem;
}

.incident-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--gray-100);
}

.incident-time {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.incident-status {
    padding: 2px 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.incident-status.new {
    background: var(--info);
    color: var(--white);
}

.incident-status.enroute {
    background: var(--warning);
    color: var(--gray-800);
}

.incident-status.onsite {
    background: var(--success);
    color: var(--white);
}

.incident-status.resolved {
    background: var(--gray-400);
    color: var(--white);
}

/* ========================================
   Incident Detail
   ======================================== */
.detail-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--gray-200);
}

.btn-back {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-700);
    transition: all var(--transition-fast);
}

.btn-back:hover {
    background: var(--gray-200);
}

.detail-header h2 {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
}

.detail-header .incident-id {
    font-size: 0.75rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.detail-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.detail-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.detail-card-header i {
    color: var(--primary);
}

.detail-card-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--gray-100);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.info-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-800);
    text-align: right;
}

.status-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.status-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.status-btn i {
    font-size: 1.25rem;
}

.status-btn:hover {
    background: var(--gray-200);
}

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

.status-btn.enroute.active {
    background: var(--warning);
    color: var(--gray-800);
}

.status-btn.onsite.active {
    background: var(--info);
    color: var(--white);
}

.status-btn.intervening.active {
    background: var(--high);
    color: var(--white);
}

.status-btn.resolved.active {
    background: var(--success);
    color: var(--white);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: var(--white);
    border: 2px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 0.6875rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.action-btn i {
    font-size: 1.25rem;
    color: var(--primary);
}

.action-btn:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: var(--space-lg);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-md);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -23px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--gray-300);
    border: 2px solid var(--white);
}

.timeline-dot.active {
    background: var(--success);
}

.timeline-content {
    font-size: 0.8125rem;
}

.timeline-title {
    font-weight: 600;
    color: var(--gray-800);
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ========================================
   Map Tab
   ======================================== */
.map-container {
    height: calc(100vh - 260px);
    background: var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

#live-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.map-legend-inline {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-top: var(--space-xs);
}

.map-legend-inline .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.625rem;
    color: var(--gray-600);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* Custom Map Markers */
.custom-marker-wrapper {
    background: transparent !important;
    border: none !important;
}

.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.custom-marker i {
    transform: rotate(45deg);
    color: white;
    font-size: 14px;
}

.custom-marker.critical { background: var(--critical); }
.custom-marker.high { background: var(--high); }
.custom-marker.medium { background: var(--medium); }
.custom-marker.low { background: var(--low); }

/* Map Popup Styles */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md);
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    min-width: 200px;
}

.map-popup {
    padding: var(--space-sm);
}

.map-popup-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--gray-200);
}

.map-popup-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

.map-popup-icon.fire { background: var(--bfp); }
.map-popup-icon.medical { background: var(--ems); }
.map-popup-icon.crime { background: var(--pnp); }
.map-popup-icon.traffic { background: var(--traffic); }
.map-popup-icon.disaster { background: var(--mdrrmo); }

.map-popup-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.map-popup-id {
    font-size: 0.6875rem;
    color: var(--gray-500);
}

.map-popup-location {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-bottom: var(--space-sm);
}

.map-popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-popup-status {
    padding: 2px 8px;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.map-popup-btn {
    padding: 4px 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.map-popup-btn:hover {
    background: var(--primary-light);
}

.legend-dot.critical { background: var(--critical); }
.legend-dot.high { background: var(--high); }
.legend-dot.medium { background: var(--medium); }
.legend-dot.low { background: var(--low); }

/* ========================================
   Chat Tab
   ======================================== */
.chat-container {
    height: calc(100vh - 240px);
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.chat-message {
    max-width: 80%;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
}

.chat-message.received {
    align-self: flex-start;
    background: var(--gray-100);
    color: var(--gray-800);
    border-bottom-left-radius: var(--radius-sm);
}

.chat-message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: var(--white);
    border-bottom-right-radius: var(--radius-sm);
}

.chat-sender {
    font-size: 0.6875rem;
    font-weight: 600;
    margin-bottom: 2px;
    opacity: 0.7;
}

.chat-time {
    font-size: 0.625rem;
    opacity: 0.6;
    margin-top: 4px;
    text-align: right;
}

.chat-input-area {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.chat-input-area input {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    background: var(--white);
}

.chat-input-area input:focus {
    outline: none;
    border-color: var(--accent);
}

.chat-input-area .btn-icon {
    color: var(--gray-500);
}

.chat-input-area .btn-send {
    background: var(--primary);
    color: var(--white);
}

/* ========================================
   Profile Tab
   ======================================== */
.profile-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.profile-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    color: var(--white);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    font-size: 2rem;
}

.profile-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.profile-card p {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: var(--space-sm);
}

.profile-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.stat-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.profile-menu {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: var(--space-md);
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    font-size: 0.875rem;
    transition: background var(--transition-fast);
}

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

.menu-item:hover {
    background: var(--gray-50);
}

.menu-item i:first-child {
    width: 24px;
    margin-right: var(--space-sm);
    color: var(--gray-500);
}

.menu-item span {
    flex: 1;
    text-align: left;
}

.menu-item i:last-child {
    color: var(--gray-400);
    font-size: 0.75rem;
}

.menu-item.logout {
    color: var(--danger);
}

.menu-item.logout i:first-child {
    color: var(--danger);
}

/* ========================================
   Bottom Navigation
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-sm);
    color: var(--gray-500);
    font-size: 0.625rem;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.nav-item i {
    font-size: 1.25rem;
}

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

/* ========================================
   Modals
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    animation: fadeIn var(--transition-fast);
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 500px;
    animation: slideUp var(--transition-normal);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.btn-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: background var(--transition-fast);
}

.btn-close:hover {
    background: var(--gray-100);
}

.modal-body {
    padding: var(--space-lg);
}

.status-options,
.upload-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.status-option,
.upload-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.status-option i,
.upload-option i {
    font-size: 1.5rem;
    color: var(--primary);
}

.status-option:hover,
.upload-option:hover {
    background: var(--gray-200);
    transform: scale(1.02);
}

.status-option[data-status="enroute"] i { color: var(--warning); }
.status-option[data-status="onsite"] i { color: var(--info); }
.status-option[data-status="intervening"] i { color: var(--high); }
.status-option[data-status="resolved"] i { color: var(--success); }

/* ========================================
   Toast Notification
   ======================================== */
.toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: var(--white);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    animation: toastIn var(--transition-normal);
}

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

.toast-content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
}

.toast-content i {
    color: var(--accent);
}

/* ========================================
   Incident Alert
   ======================================== */
.incident-alert {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    z-index: 400;
    animation: fadeIn var(--transition-fast);
}

.alert-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    width: 100%;
    max-width: 350px;
    animation: scaleIn var(--transition-normal);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.alert-badge {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    color: var(--white);
}

.alert-badge.critical {
    background: var(--critical);
    animation: pulse 1s infinite;
}

.alert-time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.alert-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-sm);
}

.alert-description {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: var(--space-md);
}

.alert-location {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--gray-100);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--gray-700);
    margin-bottom: var(--space-lg);
}

.alert-location i {
    color: var(--danger);
}

.alert-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-sm);
}

.btn-reject {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-accept {
    background: var(--success);
    color: var(--white);
}

.btn-reject:hover {
    background: var(--gray-300);
}

.btn-accept:hover {
    background: #2f9e5f;
}

/* ========================================
   Responsive Design - Tablet & Desktop
   ======================================== */
@media (min-width: 768px) {
    .login-screen {
        justify-content: center;
        align-items: center;
    }

    .login-form {
        max-width: 400px;
        width: 100%;
    }

    .main-content {
        max-width: 600px;
        margin: 0 auto;
    }

    .bottom-nav {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    .modal-content {
        border-radius: var(--radius-xl);
        margin-bottom: var(--space-xl);
    }

    .incident-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .main-content {
        max-width: 800px;
    }

    .bottom-nav {
        max-width: 800px;
    }

    .status-buttons,
    .action-buttons {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   Agency-Specific Themes
   ======================================== */
.agency-pnp { --primary: #1a365d; }
.agency-bfp { --primary: #c53030; }
.agency-ems { --primary: #2f855a; }
.agency-traffic { --primary: #b7791f; }
.agency-mdrrmo { --primary: #6b46c1; }
.agency-brgy { --primary: #2b6cb0; }

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .app-header,
    .bottom-nav,
    .status-bar {
        display: none;
    }

    .main-content {
        padding: 0;
    }
}
