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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
}

.container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

h1 {
    color: #667eea;
    margin-bottom: 5px;
    text-align: center;
    font-size: 24px;
}

.login-form, .task-view {
    display: none;
}

.login-form.active, .task-view.active {
    display: block;
}

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

label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 5px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    touch-action: manipulation;
}

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

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.btn-success {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.user-info {
    color: #666;
    font-size: 13px;
    order: -1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10px;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 10px;
    width: 100%;
    max-width: 600px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin: 10px 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #764ba2;
    margin: 0;
    font-size: 20px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.close-modal:hover {
    background: #f0f0f0;
    color: #333;
    transform: none;
}

.close-modal:active {
    background: #e0e0e0;
}

/* Lösch-Button auf Mobile als Icon */
#deleteTaskBtn {
background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
display: none;
margin-left: auto;
}

#deleteTaskBtn::before {
content: '🗑️ Löschen';
}

/* Mobile: Nur Icon anzeigen */
@media (max-width: 599px) {
    #deleteTaskBtn {
    padding: 10px;
    min-width: 40px;
    font-size: 18px;
    }

    #deleteTaskBtn::before {
    content: '🗑️';
    }
}

/* Category Section */
.category-header {
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    touch-action: manipulation;
}

.category-header:active {
    transform: translateX(3px);
}

.category-header .icon {
    font-size: 20px;
}

.category-header .count {
    background: rgba(255, 255, 255, 0.3);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
}

.task-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 5px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
    position: relative;
    touch-action: manipulation;
}

.task-card:active {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.task-card.completed {
    opacity: 0.6;
}

.task-card.overdue {
    border-left-color: #ff6b6b;
    background: #ffcccc;
}

.task-card.warning {
    border: 3px solid #ff6b6b;
    border-radius: 8px;
    background: #fff5f5;
}

.task-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    flex-shrink: 0;
    touch-action: manipulation;
    margin-top: 15px;
}

.task-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.task-title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin-bottom: 3px;
    line-height: 1.4;
    word-wrap: break-word;
}

.task-completed .task-title {
    text-decoration: line-through;
    color: #999;
}

.task-date {
    color: #666;
    font-size: 12px;
    margin-bottom: 3px;
}

.task-assignees {
    color: #667eea;
    font-size: 12px;
}

.heart-btn {
    font-size: 22px;
    cursor: pointer;
    border: none;
    background: none;
    padding: 8px;
    transition: transform 0.2s;
    flex-shrink: 0;
    touch-action: manipulation;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-top: -2px;
}

.heart-btn:active {
    transform: scale(1.15);
}

.heart-btn.assigned {
    color: #22c55e;
}

.heart-btn.not-assigned {
    color: #f44336;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.user-checkboxes {
    max-height: 200px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 5px;
    background: white;
}

.recurring-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recurring-options input[type="number"] {
    width: 100%;
}

.error {
    color: #f5576c;
    margin-top: 10px;
    font-size: 14px;
}

.success {
    color: #4caf50;
    margin-top: 10px;
    font-size: 14px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.loading {
    text-align: center;
    color: #667eea;
}

/* Tablet and Desktop optimizations */
@media (min-width: 600px) {
    body {
        padding: 20px;
    }

    .container {
        padding: 25px;
        border-radius: 15px;
    }

    h1 {
        font-size: 28px;
        margin-bottom: 20px;
    }

    input[type="text"],
    input[type="password"],
    input[type="date"],
    input[type="time"],
    input[type="number"],
    select,
    textarea {
        padding: 10px;
    }

    button {
        width: auto;
        padding: 12px 30px;
    }

    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
        margin-bottom: 30px;
    }

    .user-info {
        order: 0;
        font-size: 14px;
    }

    .user-checkboxes {
        padding: 15px;
    }

    .checkbox-label {
        margin-bottom: 10px;
    }

    .modal-content {
        padding: 30px;
    }

    .modal-header h2 {
        font-size: 24px;
    }

    .category-section {
        margin-bottom: 30px;
    }

    .category-header {
        padding: 15px 20px;
        font-size: 18px;
    }

    .category-header .icon {
        font-size: 24px;
    }

    .category-header .count {
        font-size: 14px;
    }

    .category-header:hover {
        transform: translateX(5px);
    }

    .task-card {
        padding: 15px;
        gap: 15px;
        margin-bottom: 12px;
    }

    .task-card:hover {
        transform: translateX(5px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .task-checkbox {
        width: 24px;
        height: 24px;
    }

    .task-title {
        font-size: 16px;
        margin-bottom: 5px;
    }

    .task-date {
        font-size: 13px;
    }

    .task-assignees {
        display: block;
        font-size: 13px;
    }

    .heart-btn {
        font-size: 24px;
        padding: 5px;
        min-width: auto;
        min-height: auto;
    }

    .heart-btn:hover {
        transform: scale(1.2);
    }

    .recurring-options {
        flex-direction: row;
        align-items: center;
    }

    .recurring-options input[type="number"] {
        width: 80px;
    }

    .loading {
        padding: 20px;
    }
}

/* Large Desktop */
@media (min-width: 1024px) {
    .container {
        padding: 30px;
    }
}
