:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --text: #333;
    --light: #f8f9fa;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.container {
    max-width: 800px;
    width: 100%;
    background: white;
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow-x: hidden;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--primary), #3f37c9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: #555;
}

.btn {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(67, 97, 238, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* ============================================
   CHECKLISTEN-STILE
   ============================================ */

/* Container für Checklisten-Liste */
.checklist-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

/* Einzelne Checklisten-Karte */
.checklist-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: left;
    transition: transform 0.2s ease;
}

.checklist-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.create-btn-bottom {
    margin-top: 2rem;
    width: 100%;
}

.checklist-card {
    position: relative;
    cursor: move;
}

.checklist-card .drag-handle {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 1.2rem;
    user-select: none;
    padding: 0 0.25rem;
}

.checklist-card .checklist-content {
    padding-left: 1.5rem;
}

.checklist-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.item-count {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Checklisten-Aktionen */
.checklist-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-open {
    background-color: var(--primary);
}

.btn-edit {
    background-color: #ffc107;
    color: #333;
}

.btn-edit:hover {
    background-color: #e0a800;
}

.btn-delete {
    background-color: #e74c3c;
}

.btn-delete:hover {
    background-color: #c0392b;
}

/* Bemerkungs-Eingabefeld */
.remark-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    min-width: 150px;
    max-width: 300px;
}

.remark-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    text-align: left;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    font-weight: bold;
}

.modal-close:hover {
    color: var(--primary);
}

.modal-content h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.modal-content label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.modal-content input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-content .btn {
    width: 100%;
}

/* Edit-Checklist Modal */
.edit-checklist-modal .modal-content {
    max-width: 500px;
}

.edit-checklist-modal h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.edit-checklist-modal label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.edit-checklist-modal input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.edit-checklist-modal input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================
   CHECKLISTE BEARBEITEN (checklist.html)
   ============================================ */

.checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.checklist-header .btn {
    flex-shrink: 0;
}

/* Checklisten-Items */
.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.checklist-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    transition: background-color 0.2s ease;
    width: 100%;
    max-width: 100%;
}

/* Obere Zeile: Punkt-Name + Status-Dots */
.item-main {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
}

/* Untere Zeile: Bemerkung + Löschen */
.item-secondary {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.checklist-item:hover {
    background: #e9ecef;
}

/* Bemerkungs-Eingabefeld */
.remark-input {
    flex: 1;
    min-width: 600px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
    resize: vertical;
    min-height: 40px;
    max-height: 80px;
    height: 40px;
    font-family: inherit;
    line-height: 1.4;
    overflow-y: auto;
}

.remark-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

/* Status-Farben */
.status-offen {
    border-left: 4px solid #ffc107;
}

.status-inArbeit {
    border-left: 4px solid var(--primary);
}

.status-erledigt {
    border-left: 4px solid #28a745;
    opacity: 0.7;
}

.status-erledigt .item-text {
    text-decoration: line-through;
    color: #666;
}

.item-text {
    flex: 0 1 438px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    background: white;
    transition: border-color 0.2s ease;
    height: 40px;
    display: inline-block;
    cursor: pointer;
    min-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 150px;
    font-weight: bold;
    color: var(--primary);
}

.item-text.editing {
    display: inline-block;
    flex: 0 0 200px;
    height: 40px;
}

.item-text:focus {
    outline: none;
    border-color: var(--primary);
}

.status-select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    min-width: 120px;
}

.status-select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-icon:hover {
    background-color: #f0f0f0;
    color: #333;
}

.btn-delete-item:hover {
    background-color: #ffebee;
    color: #e74c3c;
}

/* Formular zum Hinzufügen neuer Punkte */
.add-item-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.add-item-form input[type="text"] {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.add-item-form input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

/* Hinweis-texte */
.no-checklists, .no-items {
    color: #666;
    text-align: center;
    font-style: italic;
    padding: 2rem;
}

/* ============================================
   BENUTZER-BEZOGENE STILE
   ============================================ */

/* Benutzer-Info in der Header */
.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

#welcome-message {
    font-weight: 600;
    color: var(--text);
}

.btn-logout {
    background-color: #6c757d;
    flex-shrink: 0;
}

.btn-logout:hover {
    background-color: #5a6268;
}

.btn-admin {
    background-color: var(--primary);
    flex-shrink: 0;
}

.btn-admin:hover {
    background-color: var(--primary-dark);
}

/* Login-Seite */
.login-form {
    max-width: 400px;
    margin: 2rem auto 0;
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.error-message {
    color: #e74c3c;
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
}

/* Admin-Seite */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-header .btn {
    flex-shrink: 0;
}

.admin-actions {
    margin-bottom: 2rem;
}

.users-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.user-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.user-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-username {
    font-weight: 600;
    font-size: 1.1rem;
}

.user-role {
    font-size: 0.9rem;
    color: #666;
    background: #f8f9fa;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.user-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Formular in Modal */
#user-form .form-group {
    margin-bottom: 1rem;
}

#user-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

#user-form input[type="text"],
#user-form input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    box-sizing: border-box;
}

#user-form input[type="checkbox"] {
    margin-right: 0.5rem;
}

#user-form .form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ============================================
   STATUS-FORTSCHRITT (auf Checklisten-Karten)
   ============================================ */

.checklist-header {
    margin-bottom: 1rem;
}

.checklist-header h3 {
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.checklist-header .item-count {
    color: #666;
    font-size: 0.85rem;
    margin: 0;
}

.status-progress {
    margin-bottom: 1rem;
}

.progress-bar {
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    display: flex;
}

.progress-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.progress-segment.offen {
    background: #ffc107;
}

.progress-segment.inArbeit {
    background: var(--primary);
}

.progress-segment.erledigt {
    background: #28a745;
}

.status-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #555;
}

/* Status-Dots (farbige Punkte zum Status ändern) */
.status-dots {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex: 0 0 200px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.status-dot {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.status-dot:hover {
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.05);
}

.status-dot.active {
    background-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.3);
}

.dot {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    transition: transform 0.1s ease;
}

.dot.offen {
    background-color: #ffc107;
}

.dot.inArbeit {
    background-color: var(--primary);
}

.dot.erledigt {
    background-color: #28a745;
}

.dot-label {
    font-size: 0.7rem;
    color: #666;
    white-space: nowrap;
}

.status-dot.active .dot-label {
    color: var(--text);
    font-weight: 600;
}



/* Drag & Drop Stile */
.drag-handle {
    cursor: move;
    padding: 0 0.5rem;
    color: #999;
    font-size: 1.2rem;
    user-select: none;
}

.checklist-item.dragging {
    opacity: 0.5;
    background-color: #e3f2fd;
}

.checklist-item.drag-over {
    border: 2px dashed var(--primary);
    background-color: #f0f7ff;
}

.checklist-item.drag-over.dragging {
    border: 2px dashed var(--primary);
    background-color: #e3f2fd;
}

/* Drag & Drop für Checklisten-Karten */
.checklist-card.dragging {
    opacity: 0.5;
    background-color: #f0f7ff;
}

.checklist-card.drag-over {
    border: 2px dashed var(--primary);
    background-color: #f8f9fa;
}

.checklist-card.drag-over.dragging {
    border: 2px dashed var(--primary);
    background-color: #e3f2fd;
}

/* Checklisten-Action Icons */
.checklist-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.checklist-actions .btn-icon {
    font-size: 1.2rem;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
}

.checklist-actions .btn-open {
    color: var(--primary);
}

.checklist-actions .btn-open:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.checklist-actions .btn-delete {
    color: #e74c3c;
}

.checklist-actions .btn-delete:hover {
    background-color: rgba(231, 76, 60, 0.1);
}

/* Confirm-Dialog Stile */
.confirm-modal .modal-content {
    max-width: 400px;
    text-align: center;
}

.confirm-content h3 {
    color: #e74c3c;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.confirm-message {
    color: #555;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.confirm-buttons .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
}

.btn-confirm {
    background-color: #e74c3c;
}

.btn-confirm:hover {
    background-color: #c0392b;
}

.btn-cancel {
    background-color: #6c757d;
}

.btn-cancel:hover {
    background-color: #5a6268;
}

/* Reset-Button */
.btn-reset {
    background-color: #6c757d;
    margin-top: 1rem;
    width: 100%;
}

.btn-reset:hover {
    background-color: #5a6268;
}

/* Responsive Anpassungen */
@media (max-width: 480px) {
    .confirm-buttons {
        flex-direction: column;
    }
    .confirm-buttons .btn {
        width: 100%;
    }

    .checklist-card .drag-handle {
        left: 0.25rem;
    }
    
    .checklist-card .checklist-content {
        padding-left: 1.75rem;
    }
    
    .checklist-actions {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.25rem;
    }
    
    .checklist-actions .btn-icon {
        padding: 0.5rem;
        font-size: 1.4rem;
    }
    

    
    .item-main {
        flex-direction: column;
    }
    
    .status-dots {
        justify-content: flex-start;
    }
    
    .item-secondary {
        flex-direction: column;
        align-items: stretch;
    }
    
    .remark-input {
        width: 100%;
    }
    
    .status-dots {
        flex-direction: row;
        justify-content: center;
    }
    
    .status-dot {
        flex-direction: column;
    }
    
    .add-item-form {
        flex-direction: column;
    }
    
    .modal-content input[type="text"],
    .edit-checklist-modal input[type="text"] {
        width: 100%;
    }
}

