* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background-color: #ecf0f1;
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    text-align: center;
}

body.dark-mode {
    color: #ecf0f1;
    background-color: #2c3e50;
}

header, main {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    margin-bottom: 20px;
}

#logo {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2980b9;
    letter-spacing: -1px;
}

#logo span {
    color: #3498db;
    font-weight: normal;
}

#subheading {
    font-size: 1em;
    color: #7f8c8d;
    margin-bottom: 15px;
}

#task-form, .option-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    justify-content: center;
    width: 100%;
}

input[type="text"], select {
    flex: 1 0 200px;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 16px;
}

button {
    padding: 10px 15px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    font-size: 16px;
}

button:hover {
    background-color: #2980b9;
}

button:active {
    transform: scale(0.98);
}

#total-time {
    font-size: 1.2em;
    margin-top: 5px;
    margin-bottom: 10px;
    color: #34495e;
}

#tasks-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

#active-tasks, #completed-tasks-section {
    width: 100%;
}

h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #2c3e50;
}

.task-item {
    background-color: #fff;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.task-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.task-info {
    flex: 1 0 100%;
    text-align: left;
}

.task-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

.task-description {
    font-size: 0.9em;
    color: #34495e;
    margin-bottom: 5px;
}

.task-tags {
    font-size: 0.9em;
    color: #7f8c8d;
}

.task-timer {
    font-size: 1.2em;
    margin-right: 10px;
    color: #16a085;
}

.task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.task-actions button {
    flex: 1 0 auto;
}

.paused {
    opacity: 0.6;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.task-item {
    animation: fadeIn 0.3s ease;
}

.task-actions button.start-pause { background-color: #27ae60; }
.task-actions button.start-pause:hover { background-color: #2ecc71; }
.task-actions button.reset { background-color: #f39c12; }
.task-actions button.reset:hover { background-color: #f1c40f; }
.task-actions button.complete { background-color: #3498db; }
.task-actions button.complete:hover { background-color: #2980b9; }
.task-actions button.delete { background-color: #c0392b; }
.task-actions button.delete:hover { background-color: #e74c3c; }

body.dark-mode .task-item {
    background-color: #34495e;
    border-color: #2c3e50;
}

body.dark-mode .task-name,
body.dark-mode .task-description,
body.dark-mode .task-tags,
body.dark-mode .task-timer {
    color: #ecf0f1;
}

body.dark-mode input[type="text"],
body.dark-mode select {
    background-color: #2c3e50;
    color: #ecf0f1;
    border-color: #34495e;
}

body.dark-mode #logo,
body.dark-mode #logo span {
    color: #3498db;
}

body.dark-mode #subheading {
    color: #bdc3c7;
}

#more-options-toggle {
    display: inline-block;
    margin-bottom: 10px;
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
}

@media (max-width: 767px) {
    body {
        padding: 10px;
    }

    #logo {
        font-size: 2em;
    }

    #subheading {
        font-size: 0.9em;
    }

    input[type="text"], button, select {
        font-size: 14px;
    }

    #total-time {
        font-size: 1em;
    }

    .task-item {
        padding: 10px;
    }

    .task-timer {
        font-size: 1em;
    }

    .task-actions button {
        padding: 8px 12px;
    }
}