:root {
    --bg-gradient-start: #1e1e2f;
    --bg-gradient-end: #2d2b42;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent-color: #7b61ff;
    --accent-hover: #674df0;
    --error-color: #ff5b5b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    padding: 20px;
    transition: background 0.5s ease;
}

.app-container {
    background: rgba(30, 30, 46, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 30px;
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

/* Glassmorphism decoration elements */
.app-container::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 150px;
    height: 150px;
    background: var(--accent-color);
    border-radius: 50%;
    filter: blur(70px);
    z-index: -1;
    opacity: 0.5;
}

.app-container::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: #4facfe;
    border-radius: 50%;
    filter: blur(70px);
    z-index: -1;
    opacity: 0.4;
}

.search-section {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    position: relative;
    z-index: 10;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#city-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

#city-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(123, 97, 255, 0.2);
}

#city-input::placeholder {
    color: var(--text-secondary);
}

#search-btn {
    padding: 0 25px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

#search-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(123, 97, 255, 0.4);
}

#search-btn:active {
    transform: translateY(0);
}

.error-message {
    background: rgba(255, 91, 91, 0.1);
    border: 1px solid rgba(255, 91, 91, 0.2);
    color: var(--error-color);
    padding: 15px 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(-10px);
    display: none;
    transition: all 0.3s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
    display: flex;
    animation: fadeIn 0.3s ease;
}

.weather-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.6s ease;
}

.weather-section.hidden {
    display: none;
}

.location {
    text-align: center;
    margin-bottom: 20px;
}

#city-name {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

#country-name {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

#date-time {
    font-size: 14px;
    color: var(--text-secondary);
}

.current-weather {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.weather-icon-wrapper {
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.wea-icon {
    font-size: 80px;
    background: linear-gradient(to bottom, #ffeb3b, #ff9800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 10px 15px rgba(255, 152, 0, 0.3));
    animation: float 3s ease-in-out infinite;
}

.wea-icon.cloudy {
    background: linear-gradient(to bottom, #bdc3c7, #2c3e50);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wea-icon.rainy {
    background: linear-gradient(to bottom, #4facfe, #00f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wea-icon.snowy {
    background: linear-gradient(to bottom, #e0f7fa, #80deea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wea-icon.storm {
    background: linear-gradient(to bottom, #5c258d, #4389a2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.temperature {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

#temp {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
}

.degree {
    font-size: 30px;
    font-weight: 500;
    margin-top: 5px;
    color: var(--text-secondary);
}

.condition {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 1px;
    margin-top: 5px;
    text-transform: capitalize;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
}

.detail-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.detail-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
}

.detail-card i {
    font-size: 24px;
    color: var(--accent-color);
    width: 30px;
    text-align: center;
}

.detail-info .label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.detail-info .value {
    font-size: 16px;
    font-weight: 600;
}

.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.loader.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 400px) {
    .app-container {
        padding: 30px 20px;
    }
    .weather-details {
        grid-template-columns: 1fr;
    }
}
