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

/* Weather Wrapper for Flex Layout */
.weather-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.weather-widget-container {
    flex: 1;
    max-width: 900px;
}

/* Weather Widget Base Styles */
.weather-widget {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

/* Search Bar Styling (Right Side) */
.weather-search-container {
    margin: 0;
    padding: 0;
    position: relative;
    width: 100%;
    max-width: 300px;
}

#weather-city-search {
    width: 100%;
    padding: 8px 12px;
    margin: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    outline: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>') no-repeat 95% center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    outline: none;
    transition: all 0.3s ease;
}

#weather-city-search:focus {
    border-color: #1f567c;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%231f567c" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>') no-repeat 95% center;
}

.weather-city-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    list-style: none;
    padding: 10px 0;
    margin: 5px 0 0;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.weather-city-suggestions li {
    padding: 12px 15px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s ease, padding-left 0.2s ease;
}

.weather-city-suggestions li:hover,
.weather-city-suggestions li.selected {
    background: #f0f0f0;
    padding-left: 20px;
}

.weather-city-suggestions li::before {
    content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%231f567c" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>');
    margin-right: 10px;
}

/* Scrollbar Styling for Suggestions */
.weather-city-suggestions::-webkit-scrollbar {
    width: 8px;
}

.weather-city-suggestions::-webkit-scrollbar-thumb {
    background: #1f567c;
    border-radius: 4px;
}

.weather-city-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* Current Weather Section - Left Side */
.current-weather {
    flex: 0 0 35%;
    position: relative;
    padding: 10px;
    color: #fff;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    border-radius: 15px 0 0 15px;
    text-align: center;
    overflow: hidden;
    height: 300px;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    isolation: isolate;
}

.current-weather::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.2), transparent 70%);
    z-index: 0;
    animation: pulse 10s infinite ease-in-out;
}

.current-weather::after {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 50%;
    height: 50%;
    background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"%3E%3Cpath d="M50 10 L90 90 H10 Z" fill="rgba(255,255,255,0.1)" /%3E%3C/svg%3E') no-repeat;
    opacity: 0.3;
    transform: rotate(45deg);
    z-index: 0;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.1); opacity: 0.4; }
}

.current-weather .current-heading {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-transform: capitalize;
    letter-spacing: 0.8px;
    z-index: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.current-weather img {
    width: 60px;
    height: 60px;
    margin: 5px 0;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
    z-index: 1;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    padding: 6px;
    transition: transform 0.3s ease;
}

.current-weather img:hover {
    transform: scale(1.1);
}

.current-weather .current-temperature {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin: 5px 0;
    z-index: 1;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    background: linear-gradient(180deg, #ffd700, #ffa500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.current-weather .current-description {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-transform: capitalize;
    z-index: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.current-weather .weather-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    backdrop-filter: blur(8px);
    z-index: 1;
    width: 70%;
    max-width: 200px;
}

.current-weather .weather-info .info-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.current-weather .weather-info .info-item p {
    font-size: 0.8rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    margin: 0;
}

/* Forecast Days Section - Right Side */
.forecast-days {
    flex: 0 0 65%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px;
    background: linear-gradient(145deg, #1a5276, #2c3e50);
    border-radius: 0 15px 15px 0;
    gap: 10px;
    height: 300px;
    align-items: center;
    scrollbar-width: thin;
    scrollbar-color: #0077ff #e0e0e0;
}

.forecast-days::-webkit-scrollbar {
    height: 8px;
}

.forecast-days::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 4px;
}

.forecast-days::-webkit-scrollbar-thumb {
    background: #0077ff;
    border-radius: 4px;
}

.weather-item {
    flex: 0 0 120px;
    background: #34495e;
    border-radius: 8px;
    padding: 5px;
    text-align: center;
    color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    height: 90%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 100px;
}

.weather-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.weather-item img {
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.weather-item .date {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: capitalize;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.weather-item .temperature {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #ffd700;
}

.weather-item .description {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: capitalize;
    opacity: 1.5;
}

.weather-item .wind-speed {
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

/* Responsive Adjustments */
@media only screen and (max-width: 768px) {
    .weather-wrapper {
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 100%;
        margin: 20px auto;
        padding: 0 10px;
    }

    .weather-widget {
        max-width: 100%;
        width: 100%;
        margin: 20px auto;
        padding: 0;
        flex-direction: column;
    }

    .weather-search-container {
        width: 100%;
        max-width: 400px;
        margin-top: 15px;
    }

    #weather-city-search {
        font-size: 14px;
        padding: 12px 40px 12px 15px;
        border: 2px solid #1f567c;
        background: linear-gradient(135deg, #ffffff, #e6f0fa) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>') no-repeat 95% center;
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
    }

    #weather-city-search:focus {
        border-color: #0077ff;
        box-shadow: 0 8px 25px rgba(0, 119, 255, 0.3);
        background: linear-gradient(135deg, #ffffff, #e6f0fa) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%230077ff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>') no-repeat 95% center;
    }

    .weather-city-suggestions {
        border: 2px solid #1f567c;
        background: linear-gradient(135deg, #ffffff, #f0f5ff);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
        border-radius: 10px;
    }

    .weather-city-suggestions li {
        font-size: 14px;
        padding: 12px 15px;
        font-weight: 500;
        color: #1f567c;
        transition: all 0.3s ease;
    }

    .weather-city-suggestions li:hover {
        background: #1f567c;
        color: #fff;
        padding-left: 20px;
        box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    .current-weather {
        flex: 0 0 100%;
        border-radius: 15px 15px 0 0;
        height: auto;
        padding: 15px;
        background: linear-gradient(135deg, #1e3c72, #2a5298);
        color: #fff;
    }

    .forecast-days {
        flex: 0 0 100%;
        border-radius: 0 0 15px 15px;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
        padding: 15px 1px 15px 1px; /* Top 15px, Right 1px, Bottom 15px, Left 1px */
        gap: 15px;
        background: #1a1a2e;
        color: #fff;
    }

    .weather-item {
        flex: 0 0 auto;
        width: 90%;
        max-width: 400px;
        margin: 0 auto 15px;
        height: auto;
        padding: 15px;
        background: linear-gradient(135deg, #16213e, #1a243a);
        border-radius: 12px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
        border: 2px solid #4a90e2;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        overflow: hidden;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .weather-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
    }

    .weather-item img {
        width: 35px;
        height: 35px;
        margin: 0;
        filter: brightness(1.2);
    }

    .weather-item .date {
        font-size: 0.7rem;
        font-weight: 700;
        margin: 0;
        text-transform: capitalize;
        color: #fff;
        flex: 1;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
        white-space: nowrap;
    }

    .weather-item .temperature {
        font-size: 1.2rem;
        font-weight: 800;
        margin: 0;
        color: #e6b800;
        flex: 0 0 auto;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    .weather-item .description {
        font-size: 0.9rem;
        font-weight: 500;
        margin: 0;
        text-transform: capitalize;
        opacity: 0.9;
        color: #fff;
        flex: 1;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    .weather-item .wind-speed {
        font-size: 0.7rem;
        font-weight: 400;
        margin: 0;
        color: #fff;
        flex: 0 0 auto;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        white-space: nowrap;
        padding: 2px 6px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
    }
}

@media only screen and (max-width: 480px) {
    .weather-wrapper {
        padding: 0 5px;
        margin: 20px auto;
    }

    .weather-search-container {
        max-width: 100%;
        padding: 0;
    }

    #weather-city-search {
        font-size: 13px;
        padding: 10px 35px 10px 12px;
        border: 2px solid #1f567c;
        background: linear-gradient(135deg, #ffffff, #e6f0fa) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>') no-repeat 95% center;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    #weather-city-search:focus {
        border-color: #0077ff;
        box-shadow: 0 6px 20px rgba(0, 119, 255, 0.3);
        background: linear-gradient(135deg, #ffffff, #e6f0fa) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%230077ff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>') no-repeat 95% center;
    }

    .weather-city-suggestions {
        border: 2px solid #1f567c;
        background: linear-gradient(135deg, #ffffff, #f0f5ff);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
        border-radius: 10px;
    }

    .weather-city-suggestions li {
        font-size: 13px;
        padding: 10px 12px;
        font-weight: 500;
        color: #1f567c;
    }

    .weather-city-suggestions li:hover {
        background: #1f567c;
        color: #fff;
        padding-left: 18px;
    }

    .weather-widget {
        margin: 20px auto;
        padding: 0;
    }

    .current-weather {
        padding: 10px;
        min-height: 200px;
    }

    .current-weather .current-heading {
        font-size: 0.9rem;
    }

    .current-weather img {
        width: 50px;
        height: 50px;
    }

    .current-weather .current-temperature {
        font-size: 2rem;
    }

    .current-weather .current-description {
        font-size: 0.8rem;
    }

    .current-weather .weather-info {
        flex-direction: column;
        gap: 4px;
    }

    .current-weather .weather-info .info-item p {
        font-size: 0.75rem;
    }

    .weather-item {
        width: 95%;
        padding: 12px;
        gap: 6px;
        border-radius: 10px;
        border: 1.5px solid #4a90e2;
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
    }

    .weather-item:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
    }

    .weather-item img {
        width: 30px;
        height: 30px;
    }

    .weather-item .date {
        font-size: 0.6rem;
        font-weight: 700;
    }

    .weather-item .temperature {
        font-size: 1.1rem;
    }

    .weather-item .description {
        font-size: 0.8rem;
    }

    .weather-item .wind-speed {
        font-size: 0.6rem;
        padding: 2px 5px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
    }
}

/* Ensure Desktop Remains Unchanged */
@media only screen and (min-width: 769px) {
    .weather-wrapper {
        max-width: 1200px;
        margin: 20px auto;
        padding: 0;
    }

    .weather-widget {
        max-width: 1200px;
        margin: 20px auto;
        padding: 0;
    }
}

/* Scaling for Desktop Screens Between 769px and 1200px */
@media only screen and (min-width: 769px) and (max-width: 1200px) {
    .weather-widget {
        max-width: 100%;
        margin: 20px auto;
        padding: 0;
    }

    .current-weather {
        flex: 0 0 35%;
        min-width: 200px;
        padding: 8px;
    }

    .forecast-days {
        flex: 0 0 65%;
        padding: 15px;
    }

    .weather-item {
        flex: 0 0 110px;
        min-width: 90px;
        padding: 8px;
    }

    .weather-item img {
        width: 35px;
        height: 35px;
    }

    .weather-item .date {
        font-size: 0.85rem;
    }

    .weather-item .temperature {
        font-size: 1.1rem;
    }

    .weather-item .description {
        font-size: 0.75rem;
    }

    .weather-item .wind-speed {
        font-size: 0.65rem;
    }
}