/* General */

body {
    font-family: sans-serif;
    padding: 2rem;
}

.main-content {
    display: flex;
    flex-direction: column; 
    align-items: center;    
    gap: 2rem;              
    max-width: 800px;       
    margin: 0 auto;         
    padding: 0 1rem;        
}
/* App Header */
.app-header {
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
}

.app-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.app-header p {
    font-size: 1rem;
    color: #555;
    line-height: 1.5;
}


/* City list */

.cities {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.city-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
}


.city-row a {
    flex-grow: 1;
    margin-right: 1rem;
    text-decoration: none;
    color: #0066cc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.city-row a:hover {
    text-decoration: underline;
}

/* Delete form */
.delete-form {
    display: inline;
}

.delete-form button {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 0.5rem 0.5rem;
    cursor: pointer;
}

.delete-form button:hover {
    background: #c0392b;
}

/* Add city */
.add-city-form {
    margin-top: 1rem;
}

.add-city-form input {
    padding: 0.5rem;
}

.add-city-form button {
    padding: 0.5rem 0.5rem;
}

/* Unit toggle */
.unit-toggle {
    display: inline-flex;
    border: 1px solid #ccc;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.unit-toggle a {
    text-decoration: none;
    padding: 0.5rem 0.5rem;
    color: #333;
    background-color: #f0f0f0;
    transition: background-color 0.2s;
}

.unit-toggle a.active {
    background-color: #333;
    color: #fff;
}

.unit-toggle a:not(.active):hover {
    background-color: #ddd;
}

/* Weather error page */
.weather-error-container {
    max-width: 500px;
    margin: 100px auto;
    padding: 30px;
    border: 2px solid #ff6b6b;
    border-radius: 12px;
    background-color: #ffecec;
    text-align: center;
    font-family: Arial, sans-serif;
}

.weather-error-container h1 {
    font-size: 2rem;
    color: #d32f2f;
    margin-bottom: 16px;
}

.weather-error-message {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 24px;
}

.back-button {
    display: inline-block;
    text-decoration: none;
    background-color: #d32f2f;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.back-button:hover {
    background-color: #a52828;
}

/* ===== City weather page ===== */

.weather-card {
    max-width: 520px;
    margin: 80px auto;
    padding: 32px;
    border: 1px solid #ccc;
    border-radius: 12px;
    background-color: #fff;
    /* background-color: red; */
}

/* Title */

.city-title {
    margin: 0 0 24px 0;
    font-size: 2rem;
    color: #333;
    text-align: center;
}

/* Details layout */

.weather-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

/* Single row */

.weather-details > div {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 12px 16px;
    border: 1px solid #eee;
    border-radius: 8px;
}

/* Labels */

.weather-details span {
    color: #666;
    font-size: 0.95rem;
}

/* Values */

.weather-details strong {
    color: #222;
    font-weight: 600;
}

/* Back link */

.back-button {
    display: inline-block;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid #333;
    border-radius: 6px;
    color: #333;
    transition: background-color 0.2s, color 0.2s;
}

.back-button:hover {
    background-color: #333;
    color: #fff;
}

