/* ==============================
   CarlottaX – Task Detail Styles
   basiert auf base.css
   ============================== */

main {
    flex: 1;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 2rem;
    margin-left: 220px; /* Platz für Sidebar */
}

h1 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
    color: var(--c-accent-2);
}

h2 {
    margin: 1rem 0 0.5rem;
    font-size: 1.2rem;
    color: var(--c-accent);
}

/* ---- Task Overview ---- */
#task-overview {
    background: var(--c-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.task-meta p {
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

.task-description-box {
    margin-top: 1.5rem;
    background: var(--c-surface-solid);
    border-radius: var(--radius);
    border: 1px solid color-mix(in oklab, var(--c-muted) 20%, transparent);
    padding: 1rem;
}

/* ---- Sidebar ---- */
#task-sidebar {
    background: var(--c-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    align-self: start;
}

#assigned-users-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.user-chip {
    background: color-mix(in oklab, var(--c-accent-2) 20%, transparent);
    color: var(--c-accent-2);
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.user-chip .remove {
    background: none;
    border: none;
    color: crimson;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
}

.user-actions {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ---- Edit Section ---- */
#task-edit {
    grid-column: 1 / span 2;
    background: var(--c-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-top: 2rem;
}

#toggle-edit {
    margin-bottom: 1rem;
}

#edit-task-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ---- Confirm Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal {
    background: var(--c-surface-solid);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    animation: fadeIn 0.25s ease;
    text-align: center;
}

.modal h3 {
    margin-top: 0;
    color: var(--c-accent);
}

.modal-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-cancel {
    background: var(--c-muted);
    color: #fff;
}

.btn-cancel:hover {
    background: color-mix(in oklab, var(--c-muted) 70%, black);
}

.btn-confirm {
    background: crimson;
    color: #fff;
}

.btn-confirm:hover {
    background: darkred;
}

/* ---- Toasts ---- */
#toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 3000;
}

.toast {
    background: var(--c-surface-solid);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--c-accent-2);
}

.toast.error {
    border-left: 4px solid crimson;
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ---- Status Badge ---- */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.active {
    background: color-mix(in oklab, var(--c-accent-2) 20%, transparent);
    color: var(--c-accent-2);
}

.status-badge.inactive {
    background: color-mix(in oklab, crimson 20%, transparent);
    color: crimson;
}

/* ---- Toggle Active Button ---- */
.task-actions {
    margin-top: 1rem;
}

#toggle-active {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}
