
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(to bottom right, #1a1a2e, #16213e, #0f3460);
    min-height: 100vh;
    padding: 40px 20px;
    background-attachment: fixed;
    position: relative;
}

/* Background image overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('background%20image.gif');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}

/* Main Container */
.container {
    max-width: 950px;
    margin: 0 auto;
}

/* Header Row */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

h1 {
    color: #fff;
    font-size: 2.8em;
    font-weight: 300;
}

/* Search Section - Horizontal Bar Style */
.search-section {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 35px;
    border: 1px solid rgba(255,255,255,0.1);
}

.search-container {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 10px;
    align-items: center;
}

#cityInput {
    padding: 15px 20px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    outline: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    transition: 0.2s;
}

#cityInput::placeholder {
    color: rgba(255,255,255,0.5);
}

#cityInput:focus {
    background: rgba(255,255,255,0.25);
}

/* Buttons - Flat Modern Style */
.btn {
    padding: 15px 22px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: #00d9ff;
    color: #000;
}

.btn-primary:hover {
    background: #00b8d4;
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.2);
}

/* Temperature Unit Selector */
.unit-select {
    padding: 15px 18px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
    outline: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="white" d="M6 9L1 4h10z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.unit-select:hover {
    background-color: rgba(255,255,255,0.25);
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="white" d="M6 9L1 4h10z"/></svg>');
}

.unit-select option {
    background: #1a1a2e;
    color: #fff;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    text-align: left;
    margin: 2px 0;
}

.unit-select option:hover,
.unit-select option:checked {
    background: #00d9ff;
    color: #000;
    box-shadow: 0 4px 8px rgba(0, 217, 255, 0.3);
    transform: translateY(-1px);
}

.unit-select option:checked {
    background: linear-gradient(90deg, #00d9ff 0%, #0099cc 100%);
    font-weight: 600;
    position: relative;
}

.unit-select option:checked::after {
    content: '✓';
    position: absolute;
    right: 10px;
    color: #000;
    font-weight: bold;
}

/* Error Message - Inline Alert */
.error-message {
    color: #ffcdd2;
    background: rgba(244, 67, 54, 0.2);
    padding: 12px 18px;
    margin-top: 15px;
    border-radius: 8px;
    display: none;
    border-left: 3px solid #f44336;
    font-size: 14px;
}

/* Current Weather - Large Hero Card */
.current-weather {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(15px);
    color: white;
    padding: 0;
    border-radius: 20px;
    margin-bottom: 30px;
    display: none;
    border: 1px solid rgba(255,255,255,0.15);
    overflow: hidden;
}

.weather-main {
    padding: 40px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 30px;
    align-items: start;
}

.weather-info h2 {
    font-size: 3em;
    margin-bottom: 5px;
    font-weight: 300;
}

.weather-info p {
    font-size: 1.1em;
    opacity: 0.8;
    text-transform: capitalize;
}

.weather-temp {
    font-size: 5em !important;
    font-weight: 200;
    margin-top: 15px;
    display: block;
}

.weather-icon img {
    width: 160px;
    height: 160px;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4));
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.15);
}

.detail-item {
    text-align: center;
    padding: 25px 15px;
    border-right: 1px solid rgba(255,255,255,0.1);
}


.detail-item p:first-child {
    font-size: 0.85em;
    opacity: 0.7;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-item p:last-child {
    font-size: 1.6em;
    font-weight: 600;
}

/* Forecast Section - Compact Row Style */
.forecast-section h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 300;
}

.forecast-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.forecast-card {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    transition: 0.2s;
}

.forecast-card:hover {
    transform: scale(1.05);
    background: rgba(255,255,255,0.12);
    border-color: #00d9ff;
}

.forecast-date {
    font-weight: 500;
    color: #fff;
    margin-bottom: 12px;
    font-size: 0.95em;
}

.forecast-icon img {
    width: 55px;
    height: 55px;
    margin: 8px 0;
}

.forecast-temp {
    font-size: 1.8em;
    font-weight: 300;
    color: #00d9ff;
    margin: 10px 0;
}

.forecast-humidity {
    color: rgba(255,255,255,0.6);
    font-size: 0.8em;
}

/* Search History - Tag Style */
.search-history {
    margin-top: 20px;
    padding: 18px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.search-history h4 {
    margin-bottom: 12px;
    color: #fff;
    font-size: 0.9em;
    font-weight: 400;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-item {
    background: rgba(0, 217, 255, 0.15);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid rgba(0, 217, 255, 0.3);
    color: #00d9ff;
    font-size: 13px;
}

.history-item:hover {
    background: #00d9ff;
    color: #000;
    transform: translateY(-2px);
}


/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2em; }
    .header-row { justify-content: center; flex-direction: column; gap: 15px; }
    .search-container { grid-template-columns: 1fr; }
    .forecast-container { grid-template-columns: repeat(2, 1fr); }
    .weather-details { grid-template-columns: repeat(2, 1fr); }
    .weather-main { grid-template-columns: 1fr; text-align: center; }
    .weather-icon img { margin: 0 auto; }
}

/* Loader */
.loader {
    text-align: center;
    margin: 20px 0;
    color: #fff;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #00d9ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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