/* Reset and Base Styles */
:root {
    --primary-color: #4F46E5;
    --primary-dark: #4338CA;
    --secondary-color: #06B6D4;
    --accent-color: #8B5CF6;
    --text-color: #1F2937;
    --light-text: #6B7280;
    --background: #E6F3FF;
    --accent-bg: #F0F8FF;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --bg-gradient-1: linear-gradient(135deg, #E6F3FF, #F0F8FF);
    --bg-gradient-2: linear-gradient(135deg, #F0F8FF, #E6F3FF);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: var(--bg-gradient-1);
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
}

/* Emergency Header */
.emergency-header {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.back-to-dashboard-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.back-to-dashboard-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.emergency-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.call-ambulance-btn {
    background: #fff;
    color: var(--danger-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.call-ambulance-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .container {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Quick Actions */
.quick-actions {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.quick-actions h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.action-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem 1rem;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

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

.action-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.action-card span {
    font-weight: 600;
    font-size: 0.9rem;
}

/* AI Assistant */
.ai-assistant {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.ai-assistant h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.chat-container {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 15px;
    margin-bottom: 1rem;
}

.message {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.message.user {
    flex-direction: row-reverse;
}

.message i {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    font-size: 0.8rem;
    min-width: 35px;
    text-align: center;
}

.message.bot i {
    background: #28a745;
}

.message-content {
    background: white;
    padding: 1rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 80%;
}

.message.user .message-content {
    background: var(--primary-color);
    color: white;
}

.chat-input {
    display: flex;
    gap: 0.5rem;
}

.chat-input input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input input:focus {
    border-color: var(--primary-color);
}

.chat-input button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-input button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Location Services */
.location-services {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.location-services h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.location-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.location-btn, .map-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.location-btn:hover, .map-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.facilities-list {
    max-height: 300px;
    overflow-y: auto;
}

.facility-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

.facility-item h4 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.facility-item p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.facility-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.facility-type {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.facility-details {
    margin-bottom: 0.5rem;
}

.facility-details p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.facility-services {
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.facility-actions {
    display: flex;
    gap: 0.5rem;
}

.call-btn, .directions-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.3s ease;
}

.call-btn:hover, .directions-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    margin: 1rem 0;
}

.retry-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.loading {
    text-align: center;
    color: #6c757d;
    padding: 2rem;
}

/* Guide Display */
.guide-display {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 2rem;
}

.guide-display.hidden {
    display: none;
}

.guide-content {
    background: white;
    border-radius: 20px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.close-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.2rem;
}

.step {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 4px solid var(--primary-color);
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 1rem;
}

.step h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.step p {
    color: #6c757d;
    line-height: 1.8;
}

.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
}

.important {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    text-align: center;
}

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

.emergency-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    text-align: left;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.confirm-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #ffc107;
    color: #856404;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    z-index: 1001;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.offline-indicator.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .emergency-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .container {
        padding: 1rem;
        grid-template-columns: 1fr;
    }
    
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .location-controls {
        flex-direction: column;
    }
    
    .guide-content {
        margin: 1rem;
        padding: 1rem;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-card, .quick-actions, .ai-assistant, .location-services {
    animation: slideIn 0.5s ease-out;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
} 