body {
    font-family: sans-serif;
    margin: 0;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 30%;
    background-color: #e3e3e3;
    padding: 20px;
    box-sizing: border-box;
}

.main-content {
    width: 70%;
    padding: 20px;
    box-sizing: border-box;
}

.traffic-light {
    background-color: #555;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.light {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #777; /* Default off state */
    margin: 5px 0;
    opacity: 0.3;
}

.light.active {
    opacity: 1;
}

#light-red.active {
    background-color: red;
}

#light-yellow.active {
    background-color: yellow;
}

#light-green.active {
    background-color: green;
}

.last-input {
    background-color: #f0f0f0;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
}

.last-input h4 {
    margin-top: 0;
}

#input-section h2, #display-section h2 {
    color: #007bff;
}

#timer-form div {
    margin-bottom: 15px;
}

#timer-form label {
    display: block;
    margin-bottom: 5px;
}

#timer-form input[type="text"],
#timer-form input[type="number"] {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#timer-form button, #reset-button {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#timer-form button:hover, #reset-button:hover {
    background-color: #0056b3;
}

#display-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

#end-time-display {
    font-size: 2em;
    font-weight: bold;
    color: #28a745;
    text-align: center;
    margin-bottom: 20px;
}

#timer-details p {
    margin: 5px 0;
}

/* Add some basic styling for the language switcher */
.language-switcher {
    padding: 10px;
    text-align: center;
    background-color: #d0d0d0; /* Slightly different background for visibility */
    margin-bottom: 15px;
    border-radius: 4px;
}

.language-switcher a {
    text-decoration: none;
    color: #007bff;
    padding: 5px;
}

.language-switcher a.active {
    font-weight: bold;
    text-decoration: underline;
    color: #0056b3;
}

/* --- Responsive Design --- */

/* For tablets and larger phones (landscape) */
@media (max-width: 1024px) {
    .sidebar {
        width: 35%; /* Slightly more space for sidebar if needed */
    }
    .main-content {
        width: 65%;
    }
}

/* For smaller tablets and phones (portrait and landscape) */
@media (max-width: 768px) {
    .container {
        flex-direction: column; /* Stack sidebar and main content */
    }

    .sidebar,
    .main-content {
        width: 100%; /* Full width for both when stacked */
        min-height: auto; /* Reset min-height if it was set for flex row */
    }

    .sidebar {
        padding-bottom: 0; /* Reduce padding if elements are close */
    }

    .traffic-light {
        /* Make lights a bit smaller or arrange horizontally if needed */
        /* For now, keeping them stacked but they will take full width of the new sidebar context */
    }

    .light {
        width: 40px; /* Slightly smaller lights */
        height: 40px;
    }

    #timer-form input[type="text"],
    #timer-form input[type="number"],
    #timer-form button,
    #reset-button {
        font-size: 1rem; /* Ensure readable font size on mobile */
        padding: 12px; /* Larger padding for easier tapping */
    }

    #end-time-display {
        font-size: 1.8em; /* Adjust font size if too large */
    }

    h2 { /* Adjust heading sizes */
        font-size: 1.5em;
    }
}

/* For very small phones (portrait) */
@media (max-width: 480px) {
    .sidebar {
        padding: 15px; /* Adjust padding for very small screens */
    }
    .main-content {
        padding: 15px;
    }

    .light { /* Even smaller lights if necessary */
        width: 35px;
        height: 35px;
    }

    #end-time-display {
        font-size: 1.6em;
    }

    h2 {
        font-size: 1.3em;
    }

    /* Further reduce font sizes for form elements if needed */
    #timer-form input[type="text"],
    #timer-form input[type="number"],
    #timer-form button,
    #reset-button {
        font-size: 0.95rem;
        padding: 10px;
    }

    .language-switcher a {
        padding: 3px; /* Adjust padding for switcher links */
        font-size: 0.9em;
    }
}
