#emergency-section {
    height: 100%;
}

.emergency-module {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.emergency-header {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 1000;
}

.emergency-title {
    text-align: center;
    font-family: 'Poppins', sans-serif;
    margin-top: -5px;
}

.back-to-capture-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    color: black;
    z-index: 1000;
    border-radius: 50%;
    background: #eee;
    width: 30px;
    opacity: 0.9;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    margin-top: -15px;
}

.emergency-container {
    padding: 15px;
    display: flex;
    padding-top: 150px;
    justify-content: center;
    align-items: center;
    max-height: calc(100dvh - 150px);
    overflow-y: auto;
}

/* Mobile Breakpoint */
@media (max-height: 650px) {
    .emergency-container {
        padding-top: 250px;
    }

    .emergency-grid {
        /* Switches to 2 columns on tablets and phones */
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .emergency-item i {
        font-size: 25px;
        /* Slightly smaller icons for mobile screens */
    }
}

/* Desktop First (or Default) */
.emergency-grid {
    display: grid;
    /* This creates 4 equal columns */
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 10px;
    max-width: 1200px;
    /* Optional: centers the grid on very wide screens */
    margin: 0 auto;
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
    .emergency-grid {
        /* Switches to 2 columns on tablets and phones */
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .emergency-item i {
        font-size: 25px;
        /* Slightly smaller icons for mobile screens */
    }
}

.emergency-item {
    background-color: #2c3440;
    /* Card color */
    border-radius: 15px;
    padding: 10px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

/* The red border effect seen in the screenshot */
.emergency-item.active {
    border-color: #e74c3c;
    background-color: #242b35;
}

.emergency-item i {
    font-size: 30px;
    margin-bottom: 12px;
}

.emergency-item .label {
    font-size: 13px;
    line-height: 1.4;
    font-family: 'Poppins', sans-serif;
}

.emergency-item span {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    font-family: 'Poppins', sans-serif;
}

/* The Comment Box Wrapper */
.emergency-text-field {
    margin-top: 20px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.emergency-text-field.visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.emergency-text-field textarea {
    width: 100%;
    border-radius: 10px;
    padding: 10px;
    resize: none;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
}

.nav-next-emergency-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 1000;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
}

.next-to-location-btn {
    background-color: #EB4E3E;
    height: 40px;
    width: 300px;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-weight: bold;
    font-size: 15px;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.next-to-location-btn:hover {
    background-color: #ffff;
    color: #EB4E3E;
    border: #EB4E3E 1px solid;
}

/* Responsive: full width on mobile */
@media (max-width: 768px) {
    .next-to-location-btn {
        width: 100%;
        max-width: 100%;
    }
}