body {
    background-color: #f4f6f7; /* A very light, professional gray background */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* A cleaner, more modern font */
    color: #333; /* Dark text for better readability on a light background */
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Start content from the top */
    min-height: 100vh;
    padding: 50px 20px; /* Add padding on all sides */
    box-sizing: border-box;
}

.container {
    width: 90%;
    max-width: 600px; /* A reasonable max-width for the centered content */
    text-align: center;
}

/* --- Header Styles --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 40px;
}

.logo {
    font-size: 1.2em;
    font-weight: bold;
    font-family: 'Roboto Mono', 'Consolas', monospace; /* A distinct, techy font */
    letter-spacing: -1px;
    color: #009688; /* Use the main theme color for the logo */
}

.nav-button {
    background: #fff;
    color: #555;
    border: none;
    padding: 8px 15px;
    margin-left: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.nav-button:hover {
    background: #f0f0f0;
}

/* --- Main Timer Block Styles --- */
.timer-block {
    background-color: #fff; /* A solid white card */
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); /* A softer, more modern shadow */
    position: relative; /* Needed for positioning the fullscreen button */
    margin-bottom: 40px;
    border: 1px solid #e9ecef; /* A subtle border */
}

.timer-controls {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.1);
    padding: 5px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.control-tab {
    background: none;
    color: #555;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background 0.2s;
}

.control-tab.active {
    background: #009688;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.timer-display {
    font-size: 100px; /* Large font size for the time */
    font-weight: 600;
    margin: 10px 0;
    letter-spacing: -4px;
    font-family: 'Roboto Mono', 'Consolas', monospace; /* Match the logo font */
}

.start-button {
    background-color: #fff;
    color: #009688;
    border: none;
    padding: 15px 40px;
    border-radius: 4px;
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 15px;
    width: 100%; /* Make the button full-width */
    cursor: pointer;
    box-shadow: 0 4px #ccc; /* Simple 3D effect */
    transition: all 0.1s ease;
}

.start-button:active {
    box-shadow: 0 2px #ccc;
    transform: translateY(2px);
}

.focus-message {
    color: #aaa;
    margin-top: 20px; /* Move closer to the start button */
    font-size: 0.9em;
    line-height: 1.5;
}

/* --- Fullscreen Styles --- */
.fullscreen-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #ccc;
    font-size: 1.8em;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
    padding: 5px;
    z-index: 1001;
}

.fullscreen-button:hover {
    color: #333;
}

/* The new 'x' close button for fullscreen */
.fullscreen-close-button {
    display: none; /* Hidden by default */
    position: absolute;
    top: 10px;
    left: 50%; /* Center horizontally */
    background: none;
    border: none;
    color: #333;
    opacity: 0.5; /* Set opacity to 50% */
    font-size: 2.5em;
    line-height: 1;
    cursor: pointer;
    z-index: 1002;
    transform: translateX(-50%); /* Correct centering for the button */
    transition: opacity 0.2s;
}

.fullscreen-close-button:hover {
    opacity: 1;
}

/* Styles applied when the body has the 'fullscreen-active' class */
body.fullscreen-active .header,
body.fullscreen-active .tasks-section,
body.fullscreen-active .timer-controls,
body.fullscreen-active .focus-message,
body.fullscreen-active .fullscreen-button { /* Hide original fullscreen button */
    display: none; /* Hide header, tasks, and extra timer elements */
}

body.fullscreen-active .timer-block {
    background-color: #f4f6f7; /* Match body background in fullscreen */
}

body.fullscreen-active .fullscreen-close-button {
    display: block; /* Show the 'x' button */
}

body.fullscreen-active .timer-block {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; /* Horizontally center all content */
}

body.fullscreen-active .start-button {
    width: auto; /* Let the button size to its content */
    min-width: 200px; /* Ensure it's not too small */
    align-self: center; /* Center it in the flex container */
}

/* --- Tasks Section Styles --- */
.tasks-section {
    width: 100%;
    background-color: #fff;
}

.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.tasks-header h2 {
    font-size: 1.4em;
    font-weight: bold;
    margin: 0;
    text-align: left;
}

.tasks-menu {
    background: none;
    color: #555;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background 0.2s;
}

.tasks-menu:hover {
    background-color: #f0f0f0;
}

.add-task-button {
    background-color: #fff;
    color: #555;
    border: 1px dashed #ccc;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    padding: 15px;
    width: 100%;
    border-radius: 8px;
    margin-top: 10px;
    transition: all 0.2s;
}

.add-task-button:hover {
    background-color: #f9f9f9;
    border-color: #aaa;
}

/* --- Task Form & List Styles --- */
.task-form {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    text-align: left;
}

.task-input {
    width: 100%;
    border: none;
    font-size: 1.2em;
    font-weight: bold;
    padding: 10px 0;
    box-sizing: border-box;
    background: transparent;
    color: #333;
}

.task-input:focus {
    outline: none;
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.form-actions button {
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.cancel-button {
    background: none;
    color: #888;
    margin-right: 10px;
}

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

/* Utility class to hide elements */
.hidden {
    display: none;
}

.tasks-list {
    margin-bottom: 15px;
}

.task-item {
    background-color: #fdfdfd;
    color: #333;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    text-align: left;
    font-weight: bold;
    border-left: 5px solid #ccc;
    cursor: pointer;
    display: flex; /* Use flexbox to align text and button */
    justify-content: space-between;
    align-items: center;
    border: 1px solid #eee;
}

.task-item.active {
    border-left-color: #333;
}

.task-text {
    flex-grow: 1; /* Allow text to take up available space */
}

.task-delete-button {
    background: none;
    border: none;
    color: #ccc;
    font-size: 1.2em;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0 5px;
}

.task-delete-button:hover {
    color: #e74c3c; /* A brighter, modern red */
}

.task-edit-input {
    width: 100%;
    box-sizing: border-box;
    border: none;
    background-color: transparent;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    padding: 0;
    outline: none;
}

/* --- Responsive Design for Mobile --- */
@media (max-width: 620px) {
    body {
        padding: 20px 15px; /* Reduce padding on smaller screens */
        background-color: #fff; /* Use a white background for a more native app feel */
    }

    .header {
        flex-direction: column; /* Stack logo and nav on top of each other */
        gap: 15px; /* Add space between logo and nav */
        margin-bottom: 20px;
    }

    .nav {
        width: 100%;
        display: flex;
        justify-content: center; /* Center the nav buttons */
    }

    .nav-button {
        padding: 6px 10px;
        font-size: 0.8em;
        margin-left: 5px;
    }

    .timer-display {
        font-size: 80px; /* Reduce timer font size to fit screen */
    }

    .start-button {
        padding: 12px 30px;
        font-size: 1.1em;
    }

    .timer-block, .tasks-section {
        box-shadow: none; /* Remove shadows on mobile for a flatter design */
        border: none;
    }
}

@media (max-width: 620px) and (orientation: landscape) {
    body.fullscreen-active .timer-display {
        font-size: 20vh; /* Adjust font size for landscape mobile */
    }
}