* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background-color: white;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-item {
    text-decoration: none;
    color: #555;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.2s, color 0.2s;
}

.nav-item.active {
    background-color: #007bff;
    color: white;
}

.nav-item:hover {
    color: #222;
}

.nav-logout {
    margin: 0;
}

.nav-logout-button {
    background: none;
    border: 1px solid #ddd;
    color: #555;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.nav-logout-button:hover {
    border-color: #dc3545;
    color: #dc3545;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

h1 {
    text-align: center;
    color: #222;
    margin-bottom: 2rem;
}

.page h1 {
    text-align: left;
    margin-bottom: 1.5rem;
}

/* Form styles */
.task-form {
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    gap: 0.5rem;
}

.task-input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s;
}

.task-input:focus {
    border-color: #007bff;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-secondary {
    background-color: #e9ecef;
    color: #444;
}

.btn-secondary:hover {
    background-color: #dce0e4;
}

.btn-primary:hover {
    background-color: #0056b3;
}

/* Task list styles */
.task-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.task-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    color: #444;
}

.section-header h2 {
    margin: 0;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.task-count {
    background-color: #e9ecef;
    color: #666;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
}

.task-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.75rem 0.9rem;
    background-color: white;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.task-item.is-editing {
    outline: 2px solid #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.task-main {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-grab {
    border: 1px solid #ddd;
    background: #f1f3f5;
    color: #666;
    border-radius: 6px;
    padding: 0.25rem 0.35rem;
    cursor: grab;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


.task-grab-icon {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: -0.1em;
}


.task-item.is-dragging {
    opacity: 0.6;
}

.task-item.completed .task-description {
    text-decoration: line-through;
    color: #888;
}

.toggle-form,
.delete-form,
.restore-form {
    display: flex;
    margin: 0;
    padding: 0;
}

.toggle-btn,
.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    pointer-events: none;
}

.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.task-description-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-description {
    flex: 1;
    word-break: break-word;
}

.task-description-label {
    flex: 1;
    word-break: break-word;
    cursor: text;
}

.task-description-form {
    flex: 1;
    margin: 0;
}

.task-description-input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.35rem 0.6rem;
    font-size: 0.95rem;
}

.task-meta {
    font-size: 0.85rem;
    color: #888;
}

.task-meta-row {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.task-date-chip {
    background-color: #f1f3f5;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.task-overflow {
    position: relative;
}

.task-overflow-toggle {
    cursor: pointer;
    padding: 0 0.4rem;
    font-size: 1.25rem;
    line-height: 1;
    color: #777;
    list-style: none;
}

.task-overflow-toggle::-webkit-details-marker {
    display: none;
}

.task-overflow-menu {
    position: absolute;
    right: 0;
    top: 1.6rem;
    min-width: 150px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    padding: 0.35rem;
    display: grid;
    gap: 0.25rem;
    z-index: 5;
}

.task-overflow-action {
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    display: block;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.task-overflow-action:hover {
    background: #f1f3f5;
}

.task-overflow-menu form {
    margin: 0;
}

.task-overflow-action.delete-action {
    color: #dc3545;
}

.task-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 2.6rem;
}

.task-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.task-note-toggle {
    border: 1px solid #ddd;
    background: #fff;
    color: #444;
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.task-note-toggle.has-note {
    border-color: #007bff;
    color: #007bff;
    font-weight: 600;
}

.task-schedule-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    align-items: center;
}

.schedule-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.schedule-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.task-date-label {
    border: 1px solid #ddd;
    border-radius: 999px;
    background: #f8f9fa;
    padding: 0.2rem 0.75rem;
    font-size: 0.85rem;
    cursor: pointer;
}


.task-date-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
}

.task-schedule-btn {
    padding: 0.15rem 0.45rem;
    font-size: 0.75rem;
}


.task-note {
    width: 100%;
}

.task-note-form {
    margin: 0;
}

.task-note-textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    resize: vertical;
}

.delete-btn {
    font-size: 1.5rem;
    color: #ccc;
    line-height: 1;
    transition: color 0.2s;
}

.delete-btn:hover {
    color: #dc3545;
}

.empty-state {
    text-align: center;
    color: #888;
    padding: 2rem;
    background-color: white;
    border-radius: 4px;
}

/* Login page styles */
.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.page-login .container {
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 320px;
}

.login-container h1 {
    margin-bottom: 1.5rem;
}

.login-form {
    background-color: white;
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.login-form .form-group {
    display: block;
    margin-bottom: 1rem;
}

.login-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s;
}

.login-input:focus {
    border-color: #007bff;
}

.login-btn {
    width: 100%;
}

.error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
