/* styles_index.css */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Assistant', sans-serif;
    background-color: #3d3939; /* Light background for better readability */
    color: #333333; /* Dark text */
    direction: rtl; /* Right-to-left layout for Hebrew */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Header Styles */
.main-header {
    background-color: #ff3b3f; /* Vivid red for urgency */
    color: white;
    padding: 20px 0;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.main-header h1 {
    text-align: center;
    margin: 0;
    font-size: 2.5em;
    font-weight: 600;
}

nav {
    text-align: center;
    margin-top: 20px;
}

.nav-link {
    display: inline-block;
    margin: 10px;
    padding: 10px 20px;
    background-color: #ff3b3f;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.nav-link:hover {
    background-color: #e23337;
}

/* Live Alerts Banner */
.live-alerts-banner {
    background-color: #ffecec; /* Light red background */
    padding: 30px 0;
    border-radius: 8px;
    margin-top: 20px;
    margin-bottom: 20px; /* Added to ensure spacing */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.banner-header {
    color: #ff3b3f;
    text-align: center;
    font-size: 2em;
    margin-bottom: 20px;
    font-weight: 600;
}

.banner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#live-alerts-container {
    font-size: 1.2em;
    text-align: center;
    color: #333;
    margin-bottom: 10px;
}

#live-alerts-list {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
    max-width: 600px;
    width: 100%;
}

#live-alerts-list h3 {
    font-size: 1.5em;
    color: #ff3b3f;
    margin-bottom: 10px;
    text-align: center;
}

#live-alerts-list li {
    background-color: #ffffff;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 5px solid #ff3b3f;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

#live-alerts-list li:hover {
    background-color: #ffecec;
}

/* Main Content */
.content {
    padding: 50px 0;
}

.alerts-container {
    margin-top: 20px;
    margin-bottom: 40px;
    width: 100%;
}

.alerts-container h2 {
    color: #ff3b3f;
    font-size: 1.8em;
    margin-bottom: 20px;
    border-bottom: 2px solid #ff3b3f;
    padding-bottom: 10px;
    text-align: center;
}

.alert {
    background-color: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 10px;
    transition: box-shadow 0.3s ease;
}

.alert:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.alert-header {
    display: flex;
    flex-direction: column; /* Stack items vertically */
    justify-content: flex-start;
    align-items: flex-start; /* Align content to the start (left) */
    margin-bottom: 15px;
}

.alert-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #333333;
    margin: 0;
}

.alert-subheader {
    font-size: 1.1em;
    color: #ff3b3f;
    margin-top: 5px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-align: left; /* Align subheader to the left */
}

.alert-threats img {
    width: 40px;
    height: 40px;
    margin-left: 10px;
}

.alert-cities {
    font-size: 1em;
    color: #555555;
}

/* Popup styling */
.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    padding: 30px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    z-index: 1002; /* Ensure it appears above other elements */
    width: 90%;
    max-width: 400px;
    text-align: center;
    border-radius: 10px;
}

.popup strong {
    font-size: 1.2em;
    color: #ff3b3f;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

.close-popup {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #ff3b3f;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
    width: 100%; /* Full-width button for mobile */
}

.close-popup:hover {
    background-color: #e23337;
}

.close-popup:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 59, 63, 0.5);
}

/* Redesigned Mute and Speech Buttons */
.mute-button,
.speech-button {
    background: linear-gradient(135deg, #ff7e5f, #feb47b); /* Gradient background */
    color: #ffffff;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: fixed;
    right: 20px; /* Moved buttons to the right side */
    bottom: 20px;
    z-index: 1003; /* Ensure buttons are above other elements */
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mute-button::before {
    content: "\1F507"; /* Unicode character for muted speaker */
    font-size: 1.2em;
}

.speech-button::before {
    content: "\1F50A"; /* Unicode character for speaker with sound waves */
    font-size: 1.2em;
}

.mute-button:hover,
.speech-button:hover {
    background: linear-gradient(135deg, #feb47b, #ff7e5f);
    transform: translateY(-2px);
}

.mute-button:focus,
.speech-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 126, 95, 0.5); /* Focus ring */
}

.mute-button {
    bottom: 80px; /* Adjust positioning to prevent overlap */
}

.speech-button {
    bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-header h1 {
        font-size: 2em;
    }

    .mute-button,
    .speech-button {
        position: relative;
        width: 100%;
        margin: 10px 0;
        right: 0;
        bottom: 0;
    }

    .banner-header {
        font-size: 1.5em;
    }

    .alerts-container h2 {
        font-size: 1.5em;
    }

    .alert-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .alert-threats img {
        width: 35px;
        height: 35px;
        margin-left: 0;
        margin-top: 10px;
    }

    .popup {
        width: 80%; /* Ensure popup fits well within smaller screens */
        padding: 20px;
    }

    /* Reduce padding in the live alerts banner */
    .live-alerts-banner {
        padding: 20px 10px;
    }

    /* Ensure all elements fit within the screen width */
    .container {
        padding: 10px; /* Reduced padding for small screens */
    }

    .banner-content {
        flex-direction: column; /* Stack content vertically on small screens */
    }
}

@media (max-width: 480px) {
    .main-header h1 {
        font-size: 1.5rem;
    }

    .alerts-container h2 {
        font-size: 1.3rem;
    }

    .btn {
        font-size: 0.9rem;
    }
}

/* Accessibility Enhancements */
button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 59, 63, 0.5);
}

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

::-webkit-scrollbar-track {
    background: #f5f5f5; 
}

::-webkit-scrollbar-thumb {
    background: #ff3b3f; 
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #e23337; 
}

/* Adjust alerts container for small screens */
.alerts-container {
    margin-top: 20px;
    width: 100%;
}

.alert {
    margin-bottom: 10px;
}

/* Ensure iframe has appropriate dimensions */
iframe {
    max-width: 100%; /* Limit the width to container size */
    height: auto; /* Adjust height based on content */
    margin-top: 20px;
}
