/* ========================================
   ENHANCED EMERGENCY RESPONSE MODAL STYLES
   ======================================== */

.emergency-modal {
    position: fixed;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    border: 2px solid #f97316;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(249, 115, 22, 0.4),
                0 0 100px rgba(249, 115, 22, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    z-index: 10000;
}

.emergency-modal.hidden {
    display: none !important;
}

.emergency-modal.minimized {
    height: auto !important;
}

/* Header */
.emergency-modal-header {
    background: linear-gradient(135deg, #1a1f2e, #0d1117);
    padding: 15px 20px;
    border-bottom: 2px solid #f97316;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.emergency-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f97316;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.emergency-modal-title i {
    font-size: 20px;
    animation: siren-pulse 2s infinite;
}

@keyframes siren-pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.6;
        transform: scale(1.1);
    }
}

.emergency-status-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #22c55e;
}

.emergency-status-badge.active {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: #ef4444;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

.emergency-modal-controls {
    display: flex;
    gap: 8px;
}

.modal-control-btn {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid #f97316;
    color: #f97316;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-control-btn:hover {
    background: #f97316;
    color: #000;
    transform: scale(1.1);
}

/* Tabs */
.emergency-modal-tabs {
    display: flex;
    background: rgba(45, 55, 72, 0.5);
    border-bottom: 1px solid #30363d;
    overflow-x: auto;
}

.emergency-tab {
    flex: 1;
    min-width: 120px;
    padding: 12px 8px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #8b949e;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.emergency-tab:hover {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.emergency-tab.active {
    background: rgba(249, 115, 22, 0.15);
    border-bottom-color: #f97316;
    color: #f97316;
}

.emergency-tab i {
    font-size: 14px;
}

/* Content */
.emergency-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: rgba(22, 27, 34, 0.8);
}

.emergency-tab-content {
    display: none;
}

.emergency-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Quick Dispatch Grid */
.quick-dispatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.emergency-quick-btn {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(234, 88, 12, 0.1));
    border: 2px solid #f97316;
    padding: 25px 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #f97316;
    font-weight: 700;
    font-size: 13px;
}

.emergency-quick-btn:hover {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #000;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.4);
}

.emergency-quick-btn i {
    font-size: 32px;
}

.emergency-quick-btn.fire {
    border-color: #ef4444;
    color: #ef4444;
}

.emergency-quick-btn.fire:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.emergency-quick-btn.medical {
    border-color: #10b981;
    color: #10b981;
}

.emergency-quick-btn.medical:hover {
    background: linear-gradient(135deg, #10b981, #059669);
}

.emergency-quick-btn.police {
    border-color: #3b82f6;
    color: #3b82f6;
}

.emergency-quick-btn.police:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.emergency-quick-btn.accident {
    border-color: #eab308;
    color: #eab308;
}

.emergency-quick-btn.accident:hover {
    background: linear-gradient(135deg, #eab308, #ca8a04);
}

.emergency-quick-btn.natural {
    border-color: #06b6d4;
    color: #06b6d4;
}

.emergency-quick-btn.natural:hover {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.emergency-quick-btn.crime {
    border-color: #a855f7;
    color: #a855f7;
}

.emergency-quick-btn.crime:hover {
    background: linear-gradient(135deg, #a855f7, #9333ea);
}

/* Form Section */
.emergency-form-section {
    background: rgba(45, 55, 72, 0.3);
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 20px;
}

.emergency-form-section h4 {
    color: #f97316;
    margin: 0 0 20px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: #8b949e;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    background: rgba(22, 27, 34, 0.8);
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.emergency-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.emergency-submit-btn:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

/* Active Emergencies */
.emergency-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.emergency-filters select {
    flex: 1;
    min-width: 150px;
    padding: 8px 12px;
    background: rgba(45, 55, 72, 0.5);
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 12px;
    cursor: pointer;
}

.active-emergencies-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.emergency-item {
    background: rgba(45, 55, 72, 0.3);
    border: 1px solid #30363d;
    border-left: 4px solid #f97316;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s;
    cursor: pointer;
}

.emergency-item:hover {
    background: rgba(45, 55, 72, 0.6);
    border-left-width: 6px;
    transform: translateX(3px);
}

.emergency-item.priority-critical {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.emergency-item.priority-urgent {
    border-left-color: #f97316;
}

.emergency-item.priority-high {
    border-left-color: #eab308;
}

.emergency-item.priority-medium {
    border-left-color: #22c55e;
}

.emergency-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.emergency-type {
    color: #f97316;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.emergency-priority {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
}

.emergency-item-body {
    margin-bottom: 12px;
}

.emergency-description {
    color: #c9d1d9;
    font-size: 13px;
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.emergency-location {
    color: #8b949e;
    font-size: 12px;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.emergency-meta {
    display: flex;
    gap: 15px;
    font-size: 11px;
    color: #6e7681;
}

.emergency-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.emergency-item-actions {
    display: flex;
    gap: 8px;
}

.emergency-action-btn {
    flex: 1;
    padding: 8px;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid #f97316;
    border-radius: 6px;
    color: #f97316;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.emergency-action-btn:hover {
    background: #f97316;
    color: #000;
}

/* Resources */
.resources-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.resource-card {
    background: rgba(45, 55, 72, 0.3);
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: all 0.2s;
}

.resource-card:hover {
    background: rgba(45, 55, 72, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.resource-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
}

.police-icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.fire-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.medical-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.resource-info h4 {
    color: #c9d1d9;
    margin: 0 0 8px 0;
    font-size: 14px;
}

.resource-stats {
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.stat-available {
    color: #22c55e;
    font-size: 24px;
    font-weight: 700;
}

.stat-total {
    color: #8b949e;
    font-size: 16px;
    font-weight: 600;
}

.stat-label {
    color: #6e7681;
    font-size: 10px;
}

.nearest-units-section h4 {
    color: #f97316;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nearest-units-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Contacts */
.emergency-contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.contact-card {
    background: rgba(45, 55, 72, 0.3);
    border: 2px solid #30363d;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.contact-card.critical {
    border-color: #ef4444;
}

.contact-card.fire {
    border-color: #f97316;
}

.contact-card.police {
    border-color: #3b82f6;
}

.contact-card.medical {
    border-color: #10b981;
}

.contact-card.disaster {
    border-color: #06b6d4;
}

.contact-card.hospital {
    border-color: #8b5cf6;
}

.contact-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.contact-card.critical .contact-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.contact-card.fire .contact-icon {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.contact-card.police .contact-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.contact-card.medical .contact-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.contact-card h4 {
    color: #c9d1d9;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.contact-number {
    display: block;
    color: #f97316;
    font-size: 20px;
    font-weight: 700;
    margin: 10px 0;
    text-decoration: none;
    transition: all 0.2s;
}

.contact-number:hover {
    color: #ea580c;
    transform: scale(1.1);
}

.contact-card p {
    color: #8b949e;
    font-size: 11px;
    margin: 0;
}

.add-contact-btn {
    width: 100%;
    padding: 12px;
    background: rgba(249, 115, 22, 0.1);
    border: 2px dashed #f97316;
    border-radius: 8px;
    color: #f97316;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-contact-btn:hover {
    background: rgba(249, 115, 22, 0.2);
    border-style: solid;
}

/* Activity Log */
.log-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.log-filters input {
    flex: 2;
    padding: 8px 12px;
    background: rgba(45, 55, 72, 0.5);
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 12px;
}

.log-filters select {
    flex: 1;
    padding: 8px 12px;
    background: rgba(45, 55, 72, 0.5);
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 12px;
    cursor: pointer;
}

.activity-log-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.log-item {
    background: rgba(45, 55, 72, 0.3);
    border: 1px solid #30363d;
    border-left: 3px solid #f97316;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.log-item.log-type-dispatch {
    border-left-color: #f97316;
}

.log-item.log-type-update {
    border-left-color: #3b82f6;
}

.log-item.log-type-resolved {
    border-left-color: #22c55e;
}

.log-item.log-type-assigned {
    border-left-color: #eab308;
}

.log-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.log-content {
    flex: 1;
}

.log-text {
    color: #c9d1d9;
    font-size: 13px;
    margin: 0 0 5px 0;
    line-height: 1.4;
}

.log-time {
    color: #6e7681;
    font-size: 11px;
}

/* Footer */
.emergency-modal-footer {
    background: rgba(45, 55, 72, 0.5);
    border-top: 1px solid #30363d;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.emergency-stats {
    display: flex;
    gap: 30px;
    font-size: 12px;
    color: #8b949e;
}

.emergency-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.emergency-stats strong {
    color: #f97316;
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, #f97316 50%);
    border-bottom-right-radius: 10px;
}

.resize-handle:hover {
    background: linear-gradient(135deg, transparent 50%, #ea580c 50%);
}

/* Placeholder */
.placeholder-text {
    text-align: center;
    padding: 40px 20px;
    color: #6e7681;
    font-size: 13px;
}

/* Scrollbar */
.emergency-modal-content::-webkit-scrollbar {
    width: 8px;
}

.emergency-modal-content::-webkit-scrollbar-track {
    background: rgba(22, 27, 34, 0.5);
}

.emergency-modal-content::-webkit-scrollbar-thumb {
    background: #f97316;
    border-radius: 4px;
}

.emergency-modal-content::-webkit-scrollbar-thumb:hover {
    background: #ea580c;
}

/* Responsive */
@media (max-width: 768px) {
    .emergency-modal {
        width: 95% !important;
        height: 90% !important;
        left: 2.5% !important;
        top: 5% !important;
    }
    
    .quick-dispatch-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .resources-overview {
        grid-template-columns: 1fr;
    }
    
    .emergency-contacts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}