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

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
        Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 30px;
}

.add-todo-form form {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.todo-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
}

.todo-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-edit {
    background: #ffc107;
    color: #333;
    padding: 8px 15px;
    font-size: 0.9rem;
}

.btn-edit:hover {
    background: #ffb300;
}

.btn-delete {
    background: #dc3545;
    color: white;
    padding: 8px 15px;
    font-size: 0.9rem;
}

.btn-delete:hover {
    background: #c82333;
}

.todos-container {
    margin-top: 20px;
}

.todo-list {
    list-style: none;
}

.todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.todo-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.todo-item.completed {
    opacity: 0.6;
    border-left-color: #28a745;
}

.todo-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.toggle-form {
    margin: 0;
}

.checkbox-btn {
    width: 30px;
    height: 30px;
    border: 2px solid #667eea;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.checkbox-btn:hover {
    transform: scale(1.1);
    border-color: #764ba2;
}

.checkmark {
    color: #28a745;
    font-size: 1.2rem;
    font-weight: bold;
}

.checkmark.empty {
    display: none;
}

.todo-title {
    font-size: 1.1rem;
    color: #333;
    word-break: break-word;
}

.todo-item.completed .todo-title {
    text-decoration: line-through;
    color: #6c757d;
}

.todo-actions {
    display: flex;
    gap: 10px;
}

.delete-form {
    display: inline;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 1.1rem;
}

.edit-todo-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.form-actions {
    display: flex;
    gap: 10px;
}

.todo-info {
    background: #e9ecef;
    padding: 20px;
    border-radius: 10px;
    line-height: 1.8;
}

.todo-info p {
    margin-bottom: 10px;
}

footer {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    border-top: 1px solid #e0e0e0;
    margin-top: 20px;
}

/* Schedule Inputs */
.schedule-inputs {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.schedule-input {
    padding: 10px 15px;
    font-size: 0.9rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.schedule-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Schedule Badges */
.todo-schedule {
    display: flex;
    gap: 8px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.schedule-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-weight: 500;
}

/* Todo Info Wrapper */
.todo-info-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Scheduled Todo Indicator */
.todo-item.has-schedule {
    border-left-color: #ffc107;
    background: linear-gradient(to right, #fff9e6 0%, #f8f9fa 100%);
}

.todo-item.has-schedule:hover {
    background: linear-gradient(to right, #fff5cc 0%, #f0f1f2 100%);
}

/* Notification Controls */
.notification-controls {
    margin-top: 15px;
    text-align: center;
}

.btn-notification {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e0e0e0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.btn-notification:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-2px);
}

.btn-notification.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.btn-notification.active:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
}

.btn-notification:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.notification-icon {
    font-size: 1.2rem;
}

/* Edit Form Enhancements */
.edit-todo-form .form-group {
    margin-bottom: 20px;
}

.edit-todo-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.edit-todo-form .schedule-input {
    width: 100%;
}

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

    header h1 {
        font-size: 2rem;
    }

    .add-todo-form form {
        flex-direction: column;
    }

    .schedule-inputs {
        flex-direction: column;
    }

    .schedule-input {
        width: 100%;
    }

    .todo-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .todo-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .notification-controls {
        margin-top: 10px;
    }

    .btn-notification {
        width: 100%;
        justify-content: center;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal .todo-info {
    margin: 0 30px 30px;
}

/* htmx Loading Indicator */
.htmx-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 2000;
    animation: slideInRight 0.3s ease;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: flex;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* htmx Swap Animations */
.htmx-swapping {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.htmx-settling {
    opacity: 1;
    transition: opacity 0.3s ease;
}
