/* Custom font for better aesthetics */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    /* background-image: url('assets/images/background.jpg'); */
    background-color: #F8F8F8;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    /* overflow: hidden; */
}

.container {
    flex-grow: 1;
    /* Allow container to take up available space */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center content vertically if space permits */
    align-items: center;
    padding: 10px;
    /* Reduced padding from 20px to 10px */
    box-sizing: border-box;
    /* Include padding in element's total width and height */
    min-height: 0;
    /* Allow container to shrink if needed */
}

/* --- IMPORTANT FIX FOR FOUC/FOUL for H1 --- */
h1#alert-manager-heading {
    font-size: 4rem;
    /* Default font size before Tailwind loads, this is large */
    font-weight: 800;
    /* extabold equivalent */
    color: #1d4ed8;
    /* blue-700 equivalent */
    text-align: center;
    margin-top: 0rem !important;
    /* As per previous request */
    margin-bottom: 0rem !important;
    /* As per previous request */
    /* You might need to add a subtle text-shadow here if drop-shadow-xl is important for initial load */
    /* text-shadow: 2px 2px 4px rgba(0,0,0,0.2); */
}

/* --- END FIX for H1 --- */

.widget-card {
    background-color: #ffffff;
    border-radius: 16px;
    /* More rounded corners */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    /* Stronger, softer shadow */
    padding: 8px;
    /* Adjusted: Changed from 30px to 8px as per request */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-grow: 1;
    /* Allows cards to grow if space permits */
    flex-shrink: 1;
    /* Allows cards to shrink */
    flex-basis: 30%;
    /* Optimal for 3 columns, will wrap */
    min-width: 250px;
    /* Smallest card can be */
    max-width: 320px;
    /* Max width for a single card */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    /* Smooth transition for hover and border */
    border: 2px solid transparent;
    /* Default transparent border */
    box-sizing: border-box;
    position: relative;
    /* Added for positioning mute button */
}

.widget-card:hover {
    transform: translateY(-8px);
    /* Lift effect on hover */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    /* Enhanced shadow on hover */
}

.icon-wrapper {
    font-size: 4rem;
    /* Larger icon size */
    margin-bottom: 20px;
    color: #4c6ef5;
    /* Vibrant blue for icons */
    flex-shrink: 0;
    /* Prevent icon from shrinking */
}

.widget-title {
    font-size: 1.6rem;
    /* Larger title font */
    font-weight: 600;
    color: #344767;
    /* Darker text */
    margin-bottom: 12px;
    flex-shrink: 0;
}

.widget-value {
    font-size: 3.2rem;
    /* Even larger value font */
    font-weight: 700;
    color: #212529;
    /* Very dark for emphasis */
    line-height: 1;
    /* Tighter line height */
    flex-grow: 1;
    /* Allow value to take space if text wraps */
}

.dropdown-select {
    padding: 12px 50px;
    border-radius: 10px;
    /* More rounded */
    border: 1px solid #cdd5e7;
    /* Light gray border */
    background-color: #fcfdfe;
    /* Very light background */
    font-size: 1.15rem;
    color: #344767;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    appearance: none;
    /* Remove default arrow */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%20viewBox%3D%220%200%20292.4%20292.4%22%3E%3Cpath%20fill%3D%22%234c6ef5%22%20d%3D%22M287%2C197.9c-3.2%2C3.2-8.3%2C3.2-11.6%2C0L146.2%2C70.7L17.1%2C197.9c-3.2%2C3.2-8.3%2C3.2-11.6%2C0c-3.2-3.2-3.2-8.3%2C0-11.6l135.7-135.7c3.2-3.2%2C8.3-3.2%2C11.6%2C0l135.7%2C135.7C290.2%2C189.6%2C290.2%2C194.7%2C287%2C197.9z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}

.dropdown-select:hover {
    border-color: #8faef0;
}

.dropdown-select:focus {
    border-color: #4c6ef5;
    /* Blue border on focus */
    box-shadow: 0 0 0 4px rgba(76, 110, 245, 0.3);
    /* Focus ring */
}

/* Loading spinner */
.loader {
    border: 4px solid #f3f3f3;
    /* Light grey */
    border-top: 4px solid #4c6ef5;
    /* Blue */
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    display: none;
    /* Hidden by default */
    margin-top: 20px;
    flex-shrink: 0;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error-message {
    color: #ef4444;
    /* Red color for error */
    font-weight: 500;
}

.text-green-600 {
    color: #22c55e;
    /* Tailwind's green-600 */
}

.text-red-500 {
    color: #ef4444;
    /* Tailwind's red-500 */
}

/* Highlight color for alerts */
.alert-border {
    border-color: #ef4444;
    /* Red for alert */
}

/* Container for dropdown and images to prevent overlap */
.dropdown-images-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    /* Space between image and dropdown */
    margin-bottom: 5px;
    /* Further reduced from mb-8 to mb-5 */
    flex-wrap: wrap;
    /* Allow wrapping on smaller screens */
    flex-shrink: 0;
    /* Prevent this section from shrinking too much */
}

.alert-image {
    width: 200px;
    /* Larger size */
    height: auto;
    /* Maintain aspect ratio */
    flex-shrink: 0;
    /* Prevent image from shrinking */
}

/* Style for Alert Manager title when active */
.alert-manager-title.active-alert {
    color: #ef4444;
    /* Red color */
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
    /* Subtle glow */
    animation: pulse-red 1.5s infinite alternate;
    /* Optional: add a subtle pulse */
}

@keyframes pulse-red {
    from {
        text-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    }

    to {
        text-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
    }
}

/* Apply basic flexbox properties directly to the container to ensure immediate correct layout */
.flex.flex-wrap.justify-center.gap-10 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    /* Equivalent to Tailwind's gap-10 (10 * 0.25rem = 2.5rem = 40px) */
    width: 100%;
    /* Ensure it spans full width */
}

/* Mute button styling (general for all mute buttons) */
.mute-button {
    position: absolute;
    /* Position relative to its parent widget-card */
    top: 5px;
    /* Adjusted to be closer to the corner */
    left: 5px;
    /* Adjusted to be closer to the corner */
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid #ccc;
    border-radius: 50%;
    padding: 5px;
    /* Smaller padding for widget buttons */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    /* Lighter shadow */
    z-index: 10;
    /* Ensure it's above other content in the card */
    transition: background-color 0.2s, transform 0.2s;
    width: 30px;
    /* Fixed width */
    height: 30px;
    /* Fixed height */
}

.mute-button:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

.mute-button.muted {
    background-color: #ef4444;
    /* Red when muted */
}

.mute-button.muted svg {
    color: white;
    /* White icon when muted */
}

.mute-button svg {
    width: 18px;
    /* Smaller icons for widget buttons */
    height: 18px;
    color: #4c6ef5;
}

/* Responsive adjustments for overall layout */
/* Target the specified desktop app window size as primary concern */
@media (max-width: 1080px) or (max-height: 608px) {
    h1#alert-manager-heading {
        /* Target H1 specifically */
        font-size: 3rem !important;
        /* Still 3rem for a good balance */
        margin-top: 5px !important;
        /* Adjusted for this media query */
        margin-bottom: 5px !important;
        /* Adjusted for this media query */
    }

    .dropdown-images-container {
        gap: 10px;
        /* Smaller gap */
        margin-bottom: 8px;
        /* Adjusted */
    }

    .alert-image {
        width: 120px;
        /* Smaller images */
    }

    .dropdown-select {
        font-size: 1rem;
        /* Smaller dropdown font */
        padding: 12px 50px;
    }

    .flex-wrap.justify-center.gap-10 {
        /* Target the fixed element here too */
        gap: 15px !important;
        /* Smaller gap between cards for smaller screens */
    }

    .widget-card {
        padding: 8px;
        /* Ensure 8px padding even in media queries */
        min-width: 200px;
        /* Allow cards to shrink more */
        flex-basis: auto;
        /* Let flexbox decide */
    }

    .icon-wrapper {
        font-size: 2.5rem;
        /* Smaller icons */
        margin-bottom: 10px;
    }

    .widget-title {
        font-size: 1.2rem;
        /* Smaller title font */
        margin-bottom: 8px;
    }

    .widget-value {
        font-size: 2.5rem;
        /* Smaller value font */
    }

    .mt-12 {
        margin-top: 10px !important;
    }

    .text-lg {
        font-size: 1rem;
        /* Smaller font for status messages */
    }

    .text-base {
        font-size: 0.9rem;
    }

    .loader {
        width: 20px;
        height: 20px;
        margin-top: 10px;
    }

    .mute-button {
        width: 25px;
        /* Slightly smaller mute buttons */
        height: 25px;
        padding: 3px;
    }

    .mute-button svg {
        width: 16px;
        height: 16px;
    }
}

/* Specific rule for mobile-like widths, even within a fixed desktop app window */
@media (max-width: 900px) {
    .alert-image.right {
        display: none;
        /* Hide one image if width < 900px */
    }

    .alert-image.left {
        display: block !important;
        /* Ensure the left image is always shown if alert is active */
        margin: 0 auto;
        /* Center the single image */
    }

    /* Adjustments for when only one image is present and screen is narrow */
    .dropdown-images-container {
        flex-direction: column;
        /* Stack vertically for narrower views */
    }

    .alert-image {
        width: 100px;
        /* Even smaller single image */
    }

    /* Further reduce overall margins/paddings for narrowest views */
    h1#alert-manager-heading {
        /* Target H1 specifically */
        font-size: 2.5rem !important;
        margin-top: 5px !important;
        /* Adjusted again for very narrow */
        margin-bottom: 5px !important;
    }

    .dropdown-select {
        font-size: 0.9rem;
        padding: 12px 50px;
    }

    .widget-card {
        padding: 8px;
        /* Ensure 8px padding */
        min-width: unset;
        /* Allow to shrink completely */
        width: 90%;
        /* Take more width to fit */
    }

    .icon-wrapper {
        font-size: 2rem;
        margin-bottom: 5px;
    }

    .widget-title {
        font-size: 1rem;
        margin-bottom: 5px;
    }

    .widget-value {
        font-size: 2rem;
    }

    .flex-wrap.justify-center.gap-10 {
        /* Target the fixed element here too */
        gap: 10px !important;
        /* Even smaller gap for very narrow screens */
    }
}

/* Very aggressive scaling for extremely small heights, though 608px is already small */
@media (max-height: 500px) {
    h1#alert-manager-heading {
        /* Target H1 specifically */
        font-size: 2rem !important;
        margin-bottom: 3px !important;
        margin-top: 3px !important;
    }

    /* Even more aggressive reduction */
    .dropdown-select {
        padding: 4px 6px;
        font-size: 0.7rem;
    }

    .widget-card {
        padding: 5px;
        min-width: 150px;
    }

    .icon-wrapper {
        font-size: 1.5rem;
        margin-bottom: 2px;
    }

    .widget-title {
        font-size: 0.8rem;
        margin-bottom: 2px;
    }

    .widget-value {
        font-size: 1.5rem;
    }

    .dropdown-images-container {
        gap: 3px;
        margin-bottom: 3px;
    }

    .alert-image {
        width: 60px;
    }

    .text-lg {
        font-size: 0.8rem;
    }

    .text-base {
        font-size: 0.7rem;
    }

    .mute-button {
        width: 20px;
        /* Even smaller mute buttons */
        height: 20px;
        padding: 2px;
    }

    .mute-button svg {
        width: 14px;
        height: 14px;
    }
}