/* General Styling */
.weatherflow-container {
     /* Ensures elements are stacked vertically */
    gap: 1rem;
    max-width: 100%;
    overflow: hidden;
    align-items: flex-start; /* Align content to the left */
    font-family: 'Poppins', sans-serif;
    background-color: var(--weatherflow_background_colour) !important;
    color: var(--weatherflow_card_text_colour) !important;
    border-radius: 5px;
}

.weatherflow-header {
    width: 100%; /* Take up full width */
    text-align: left; /* Align the header text to the left */
    margin: 1rem; /* Space below the title */
}

/* Fixed Current Conditions */
.weatherflow-current {
    flex: 0 0 20%; /* Fixed width */
    margin-right: 10px;
}

/* Weather Cards */
.weatherflow-slide {
    background-color: var(--weatherflow_card_colour) !important;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    width: 100%;
    height: 100%;

    display: flex;
    justify-content: left; /* Align horizontally */
    align-items: left; /* Align vertically */
    flex-direction: column;
}

.weatherflow-slide * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.weatherflow-slide-time {
    font-size: 48px;
    font-weight: bold;
}

.weatherflow-slide-temp {
    font-size: 36px;
}

.weatherflow-slide p,
.weatherflow-icon {
    margin-left: 1rem;  /* Add margin to the left */
    margin-right: 1rem; /* Add margin to the right */
    margin-bottom: 1.5rem;/*Edge case fix for Astra theme*/
}

.weatherflow-heading, .weatherflow-location {
    color: var(--weatherflow_background_text_colour) !important;
}

.weatherflow-heading {
    font-size: 2rem;
}

.weatherflow-forecast-main {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin: 1rem;
}

/* Swiper Carousel */
.weatherflow-carousel {
    flex-grow: 1;
    overflow: hidden;
    width: 100%; /* Ensure carousel takes up the remaining space */
    display: flex;
    justify-content: center;
}

.swiper {
    width: 100%;
}

.swiper-wrapper {
    display: flex;
}

/* Icons & Info */
.weatherflow-icon {
    width: 7rem !important;
    height: auto;
}


/* Error Handling */
.weatherflow-error {
    width: 40%;
    padding: 10px;
    background-color: rgb(255, 88, 88);
    border: 1px solid red;
    margin: 20px auto;
    text-align: center; /* Center the error message */
}




/* Responsive Layout for Large Screens (Desktop) */
@media (min-width: 1200px) {
    .weatherflow-forecast-main {
        flex-direction: row; /* Arrange current conditions and forecast side-by-side */
        justify-content: flex-start;
        gap: 2rem; /* Adjust space between the current conditions and forecast */
    }
    
    .weatherflow-current {
        flex: 0 0 300px; /* Fixed width for current conditions */
        margin-bottom: 0;
    }
}

/* Responsive Layout for Medium Screens (Tablets) */
@media (max-width: 1199px) and (min-width: 768px) {
    .weatherflow-forecast-main {
        flex-direction: row; /* Keep the layout horizontal for tablets */
        justify-content: center;
        gap: 1rem;
    }
}

/* Responsive Layout for Small Screens (Phones and Small Tablets) */
@media (max-width: 767px) and (min-width: 576px) {
    .weatherflow-forecast-main {
        flex-direction: column; /* Stack current conditions and forecast cards vertically */
        gap: 1rem;
    }

    .weatherflow-carousel {
        justify-content: flex-start;
    }

    .weatherflow-current {
        width: 100%; /* Ensure current conditions take full width */
    }
    .weatherflow-slide {
        align-items: center;
        justify-content: center;
    }
}

/* Very Small Screens (Phones in Portrait Mode) */
@media (max-width: 575px) {
    .weatherflow-forecast-main {
        flex-direction: column; /* Stack everything vertically */
        gap: 1rem; /* Space between stacked elements */
    }

    .weatherflow-current {
        width: 100%;
    }
    .weatherflow-slide-time {
        font-size: 36px;
    }
    .weatherflow-slide {
        align-items: center;
        justify-content: center;
        display: flex !important;
        flex-direction: column !important;

        /*The swiper slide is display:block by default. Only needs to become flex to align in middle for small screens. !important is used to override block setting but only for small screens.*/
    }
}