/* CRITICAL: Prevent all drag behavior globally */
html, body, * {
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -o-user-select: none !important;
    user-select: none !important;
}

/* Allow text selection for input fields and content areas */
input, textarea, .content-area, .info-card p, .info-card h3, .info-card h4, .tip-description, .facility-name {
    -webkit-user-select: text !important;
    -khtml-user-select: text !important;
    -moz-user-select: text !important;
    -o-user-select: text !important;
    user-select: text !important;
}

/* Search Actions Styling */
.search-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    align-items: center;
}

.search-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6b7280;
    font-size: 14px;
}

.search-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #14beff;
    color: #14beff;
    transform: scale(1.05);
}

.search-btn i {
    pointer-events: none;
}

#voice-search-btn.listening {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Dark theme search buttons */
body.dark-theme .search-btn {
    background: rgba(31, 41, 55, 0.9);
    border-color: #4b5563;
    color: #9ca3af;
}

body.dark-theme .search-btn:hover {
    background: rgba(31, 41, 55, 1);
    border-color: #14beff;
    color: #14beff;
}

/* Search bar with action buttons */
.search-bar-container .search-bar {
    padding-right: 140px; /* Make room for 3 search buttons */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

.nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.3s ease;
    font-size: 0.9rem;
    line-height: 1.2;
    text-align: center;
    display: block;
}

.nav a:hover {
    background: rgba(255,255,255,0.2);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 30px;
    opacity: 0.95;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.emergency-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.emergency-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 2px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.emergency-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.location-header {
    text-align: center;
    margin-bottom: 30px;
}

.location-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #1e293b;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.location-subtitle {
    color: #64748b;
    font-size: 1.1rem;
}

.location-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ef4444;
    margin-bottom: 4px;
}

.stat-label {
    color: #64748b;
    font-size: 0.8rem;
}

/* First Aid Sections Grid */
.firstaid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.firstaid-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.firstaid-card:hover {
    transform: translateY(-5px);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.card-icon {
    font-size: 2rem;
    margin-right: 12px;
}

.card-title {
    font-size: 1.3rem;
    color: #1e293b;
    font-weight: 700;
}

.location-indicator {
    display: none;
    color: #059669;
    font-size: 0.8rem;
    background: #ecfdf5;
    padding: 4px 8px;
    border-radius: 6px;
    margin-left: 10px;
}

.facility-list {
    margin-bottom: 15px;
}

.facility-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border-left: 4px solid #ef4444;
    transition: all 0.3s ease;
}

.facility-item:hover {
    background: #f1f5f9;
    transform: translateX(5px);
}

.facility-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.facility-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.85rem;
    color: #64748b;
}

.facility-distance {
    color: #059669;
    font-weight: 600;
}

.view-all-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-align: center;
    width: 100%;
}

.view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

/* Emergency Contacts */
.emergency-contacts {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-bottom: 40px;
}

.emergency-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.emergency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.emergency-item {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.emergency-item h4 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.emergency-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fbbf24;
}

/* First Aid Tips */
.firstaid-tips {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
}

.tips-title {
    text-align: center;
    font-size: 1.8rem;
    color: #1e293b;
    margin-bottom: 20px;
    font-weight: 700;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.tip-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tip-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.tip-title {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 8px;
    font-weight: 600;
}

.tip-description {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Footer */
.footer {
    background: #1e293b;
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .emergency-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .firstaid-grid {
        grid-template-columns: 1fr;
    }
    
    .facility-details {
        grid-template-columns: 1fr;
    }
    
    .nav {
        gap: 10px;
    }
    
    .nav a {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* Animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Page-level Global Header & Navigation */
.page-global-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 2px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.page-nav .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 22px;
    font-size: 1.2rem;
    font-weight: 550;
    line-height: 1.3;
    color: #1e293b;
    text-decoration: none;
    text-align: center;
    border-radius: 14px;
    border: 2px solid #7c8fec;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 0 0 0 rgba(14, 165, 233, 0.15);
    transition: all 0.25s ease;
    min-height: 44px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.page-nav .nav-link:hover,
.page-nav .nav-link:focus-visible {
    color: #0e7490;
    border-color: #7c8fec;
    background: rgba(124, 143, 236, 0.12);
    box-shadow: 0 2px 8px rgba(124, 143, 236, 0.2);
    text-decoration: none;
}

.page-nav .nav-link-action {
    background: rgba(255, 255, 255, 0.6);
    color: inherit;
    border: 2px solid #7c8fec;
    box-shadow: inset 0 0 0 0 rgba(14, 165, 233, 0.15);
    text-align: center;
}

/* Desktop: Ensure proper sizing and override any mobile styles (min-width: 1025px) */
@media (min-width: 1025px) {
    .page-nav {
        padding: 12px 20px !important;
        gap: 12px !important;
        justify-content: center !important;
        overflow-x: visible !important;
    }
    
    .page-nav .nav-link {
        padding: 12px 22px !important;
        font-size: 1.2rem !important;
        min-width: auto !important;
        max-width: none !important;
        white-space: nowrap !important;
    }
    
    .page-nav .nav-link-action {
        padding: 12px 22px !important;
        font-size: 1.2rem !important;
        min-width: auto !important;
        max-width: none !important;
        white-space: nowrap !important;
    }
}

/* Tablet specific styles (769px - 1024px) - matching firstaid.html */
@media (min-width: 769px) and (max-width: 1024px) {
    .page-nav {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 8px 12px !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
        scrollbar-color: rgba(0,0,0,0.2) transparent !important;
    }
    
    .page-nav::-webkit-scrollbar {
        height: 4px !important;
    }
    
    .page-nav::-webkit-scrollbar-track {
        background: transparent !important;
    }
    
    .page-nav::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,0.2) !important;
        border-radius: 2px !important;
    }

    .page-nav .nav-link {
        flex: 0 0 auto !important;
        padding: 10px 16px !important;
        min-width: auto !important;
        font-size: 1rem !important;
        white-space: nowrap !important;
        border: 2px solid #7c8fec !important;
    }
    
    .page-nav .nav-link-action {
        flex: 0 0 auto !important;
        padding: 10px 16px !important;
        font-size: 1rem !important;
        white-space: nowrap !important;
        border: 2px solid #7c8fec !important;
    }
}

@media (max-width: 880px) {
    .page-global-header {
        position: static !important;
        top: auto !important;
    }

    .page-nav {
        overflow-x: auto;
        padding: 8px 12px;
        justify-content: flex-start;
    }

    .page-nav .nav-link {
        flex: 0 0 auto;
        padding: 10px 16px;
        min-width: auto;
        max-width: none !important;
        font-size: 1rem;
        white-space: nowrap;
        border: 2px solid #7c8fec !important;
    }
    
    .page-nav .nav-link-action {
        max-width: none !important;
        border: 2px solid #7c8fec !important;
    }
}

/* Mobile: Allow 2-line text display (override nowrap from tablet) */
@media (max-width: 480px) {
    .page-nav .nav-link,
    .page-nav .nav-link-action {
        white-space: normal !important;
        line-height: 1.2 !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    .page-nav {
        padding: 6px 10px !important;
        gap: 6px !important;
    }
    
    .page-nav .nav-link {
        flex: 0 0 auto;
        min-width: auto;
        padding: 6px 8px;
        font-size: 0.8rem;
        min-height: 52px;
        max-width: 90px;
        border: 2px solid #7c8fec !important;
    }
    
    .page-nav .nav-link-action {
        min-height: 52px;
        max-width: 90px;
        border: 2px solid #7c8fec !important;
    }
}