:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background: #bae6fd;
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px 10px;
    overflow-x: hidden;
}

.app-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    overflow: hidden;
}

header {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #334155;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 5px 5px 5px 15px;
}

.search-box:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.search-icon {
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
}

input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    padding: 10px 15px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}

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

button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

button:hover {
    background: var(--accent-hover);
}

.icon-btn {
    background: transparent;
    color: var(--accent-color);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
}

.icon-btn i {
    width: 20px;
    height: 20px;
}

.icon-btn:hover {
    background: #334155;
    color: var(--text-primary);
}

.error-msg {
    color: #ef4444;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

.hidden {
    display: none !important;
}

.current-weather {
    text-align: center;
    margin-bottom: 40px;
}

#cityName {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

#currentDate {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.main-weather {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.main-icon {
    font-size: 56px;
    line-height: 1;
    display: inline-block;
}

.temp {
    font-size: 64px;
    font-weight: 700;
    line-height: 1;
}

.desc {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    text-transform: capitalize;
}

.details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.detail-card {
    background: #334155;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.detail-card i {
    color: var(--accent-color);
    width: 24px;
    height: 24px;
}

.detail-card span {
    font-weight: 600;
    font-size: 16px;
}

.detail-card p {
    font-size: 12px;
    color: var(--text-secondary);
}

.rest-of-day {
    margin-top: 25px;
    padding: 15px;
    background: #1e3a8a;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.rest-of-day i {
    color: var(--accent-color);
    flex-shrink: 0;
}

.person-ratings {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.person-rating {
    padding: 15px;
    border-radius: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    font-weight: 600;
}

.person-rating i {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.rating-good {
    background: #14532d;
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.rating-ok {
    background: #713f12;
    border: 1px solid rgba(234, 179, 8, 0.3);
    color: #facc15;
}

.rating-bad {
    background: #7f1d1d;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.forecast h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.forecast-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.forecast-day {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 12px 15px;
    border-radius: 10px;
}

.forecast-day:hover {
    background: #334155;
}

.forecast-day.active {
    background: #1e3a8a;
    border-color: rgba(59, 130, 246, 0.4);
}

.back-to-today {
    color: var(--accent-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 10px;
}

.forecast-day .day-name {
    width: 80px;
    font-weight: 600;
}

.forecast-day .day-icon {
    font-size: 24px;
    line-height: 1;
}

.forecast-day .day-temp {
    width: 60px;
    text-align: right;
    font-weight: 600;
}

.forecast-day .day-details {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-secondary);
}

.forecast-day .day-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.forecast-day .day-details i {
    width: 14px;
    height: 14px;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: var(--text-secondary);
}

.spin {
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
    width: 32px;
    height: 32px;
    color: var(--accent-color);
}

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

@media (max-width: 480px) {
    .details {
        flex-direction: column;
    }
    
    .forecast-day {
        flex-wrap: wrap;
    }
    
    .forecast-day .day-details {
        width: 100%;
        justify-content: space-between;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--border-color);
    }
}
