/* Grundläggande stil för hela sidan */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #007bff;
    color: white;
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

main {
    flex: 1;
    padding: 1rem;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr; /* En kolumn på små skärmar */
    max-width: 1200px;
    margin: 1.5rem auto;
}

.card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.card h2 {
    color: #007bff;
    margin-top: 0;
    font-size: 1.5rem;
}

/* Tid & Datum */
#current-time {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #28a745; /* Grön färg för tid */
}

#current-date, #namnsdag {
    font-size: 1.1rem;
    color: #555;
    margin-top: 0.2rem;
}

/* Väder */
.weather-input {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

#city-input {
    padding: 0.6rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    flex-grow: 1;
    max-width: 250px;
}

#get-weather-btn {
    padding: 0.6rem 1rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#get-weather-btn:hover {
    background-color: #0056b3;
}

#weather-display p {
    margin: 0.4rem 0;
    font-size: 1.1rem;
}

#location {
    font-weight: bold;
    font-size: 1.2rem;
}

#temperature {
    font-size: 2.5rem;
    color: #dc3545; /* Röd färg för temperatur */
    font-weight: bold;
}

#weather-icon {
    width: 80px;
    height: 80px;
    margin-top: 0.5rem;
}

/* Binärklocka */
#binary-clock .binary-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
    gap: 0.5rem;
}

#binary-clock .label {
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 0.5rem;
    width: 20px; /* Jämna ut bredden för etiketter */
    text-align: right;
}

.binary-digit {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem; /* För att eventuellt visa värdet för debug */
    color: #888;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.binary-digit.active {
    background-color: #ffc107; /* Gul färg när den är aktiv */
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.6), inset 0 1px 3px rgba(0,0,0,0.2);
}

footer {
    margin-top: auto; /* Push footer to the bottom */
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem 0;
    font-size: 0.9rem;
}

/* Media Queries för större skärmar (t.ex. surfplattor och desktops) */
@media (min-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    main {
        grid-template-columns: repeat(2, 1fr); /* Två kolumner */
        padding: 1.5rem;
        gap: 2rem;
    }

    #current-time {
        font-size: 4rem;
    }

    #temperature {
        font-size: 3rem;
    }

    /* Justera layout för binärklocka på större skärmar om nödvändigt */
    #binary-clock .binary-row {
        gap: 0.8rem;
    }
    .binary-digit {
        width: 30px;
        height: 30px;
    }
}

@media (min-width: 1024px) {
    main {
        grid-template-columns: repeat(3, 1fr); /* Tre kolumner */
    }
    /* Anpassa vilka kort som ska ligga var på en 3-kolumn layout */
    #time-date-namnsdag {
        grid-column: span 1;
    }
    #weather {
        grid-column: span 1;
    }
    #binary-clock {
        grid-column: span 1;
    }
}
