/* ============================================
   TASKS WIDGET & MODAL STYLES
   ============================================ */

/* ----- WIDGET ----- */
.tasks-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.tasks-widget-header {
    display: flex;
    justify-content: flex-end;
    padding: 4px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tasks-new-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.tasks-new-btn:hover {
    background: #1d4ed8;
}

.tasks-widget-columns {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 1px;
    background: rgba(255,255,255,0.04);
}

.tasks-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.tasks-column-header {
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #94a3b8;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.15);
}

.tasks-column-header i {
    font-size: 10px;
}

.tasks-count {
    background: rgba(255,255,255,0.1);
    color: #cbd5e1;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-left: auto;
}

.tasks-column-body {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tasks-empty {
    text-align: center;
    color: #64748b;
    font-size: 12px;
    padding: 20px 8px;
    font-style: italic;
}

/* ----- SEKCJA ZAKOŃCZONE ----- */
.tasks-widget-finished {
    margin-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 6px;
}
.tasks-column-full {
    width: 100%;
}
.tasks-column-header-finished {
    color: #166534 !important;
    font-size: 11px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
}
.tasks-finished-chevron {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
    color: #166534;
}
.tasks-finished-open .tasks-finished-chevron {
    transform: rotate(180deg);
}
.tasks-finished-body {
    display: none;
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 150px;
    overflow-y: auto;
    padding: 6px;
}
.tasks-finished-open .tasks-finished-body {
    display: flex;
}
.tasks-finished-body .task-card {
    flex: 0 0 calc(50% - 3px);
    opacity: 0.65;
}
.tasks-finished-body .task-card:hover {
    opacity: 1;
}

/* ----- TASK CARD ----- */
.task-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.task-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

.task-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.task-status-badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.task-card-temat {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 4px;
    line-height: 1.3;
    word-break: break-word;
}

.task-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 11px;
    color: #94a3b8;
}

.task-person {
    font-weight: 500;
    display: flex;
    gap: 8px;
}

.task-person-from {
    color: #94a3b8;
}

.task-person-to {
    color: #60a5fa;
}

.task-deadline {
    color: #94a3b8;
}

.task-overdue {
    color: #ef4444;
    font-weight: 600;
}

.task-done-date {
    color: #22c55e;
    font-weight: 500;
}

.task-attachments {
    color: #64748b;
}

/* Status colors */
.task-status-zlecone {
    border-left: 3px solid #eab308;
}

.task-status-ultrapilne {
    border-left: 3px solid #ef4444;
    background: rgba(239, 68, 68, 0.06) !important;
}

.task-status-przeterminowane {
    border-left: 3px solid #ef4444;
    background: rgba(239, 68, 68, 0.08) !important;
}
.task-status-przeterminowane .task-deadline {
    color: #ef4444;
    font-weight: 600;
}

.task-status-zrobione {
    border-left: 3px solid #22c55e;
    background: rgba(34, 197, 94, 0.06) !important;
    opacity: 0.85;
}

/* Action buttons on cards */
.task-confirm-btn,
.task-done-btn {
    border: none;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.task-confirm-btn {
    background: #22c55e;
    color: #fff;
}
.task-confirm-btn:hover {
    background: #16a34a;
}

.task-done-btn {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
    border: 1px solid rgba(34,197,94,0.3);
}
.task-done-btn:hover {
    background: rgba(34,197,94,0.3);
}

/* ----- MODAL ----- */
.task-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: taskFadeIn 0.2s ease;
}

@keyframes taskFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.task-modal {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    width: 580px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    animation: taskSlideIn 0.25s ease;
}

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

.task-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.task-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.task-modal-header h3 i {
    color: #3b82f6;
}

.task-modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s;
}
.task-modal-close:hover {
    color: #ef4444;
    background: rgba(239,68,68,0.1);
}

.task-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.task-form-row {
    margin-bottom: 12px;
}
.task-form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.task-form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-input {
    width: 100%;
    padding: 8px 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.task-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
.task-input-readonly {
    opacity: 0.6;
    cursor: default;
}
.task-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

select.task-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}
select.task-input option {
    background: #1e293b;
    color: #e2e8f0;
}

.task-textarea {
    resize: vertical;
    min-height: 60px;
}

.task-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding-top: 6px;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 13px !important;
}
.task-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #ef4444;
}
.task-ultrapilne-text {
    font-weight: 700;
    color: #ef4444;
}

/* Attachments area */
.task-attachments-area {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    overflow: hidden;
}

.task-attachments-list {
    max-height: 120px;
    overflow-y: auto;
}

.task-att-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 12px;
    transition: background 0.15s;
}
.task-att-item:hover {
    background: rgba(255,255,255,0.03);
}

.task-att-link {
    color: #3b82f6;
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}
.task-att-link:hover {
    text-decoration: underline;
}

.task-att-size {
    color: #64748b;
    font-size: 10px;
    white-space: nowrap;
}

.task-att-delete {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    opacity: 0.5;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.15s;
}
.task-att-delete:hover {
    opacity: 1;
    background: rgba(239,68,68,0.1);
}

.task-att-pending {
    opacity: 0.6;
}
.task-att-pending-badge {
    color: #eab308;
    font-size: 10px;
    font-weight: 600;
}

.task-dropzone {
    padding: 16px;
    text-align: center;
    color: #64748b;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    border-top: 1px dashed rgba(255,255,255,0.08);
}
.task-dropzone i {
    font-size: 20px;
    color: #475569;
}
.task-dropzone-active {
    background: rgba(59,130,246,0.08);
    border-color: #3b82f6;
    color: #3b82f6;
}
.task-dropzone-active i {
    color: #3b82f6;
}

.task-file-link {
    color: #3b82f6;
    cursor: pointer;
    text-decoration: underline;
}
.task-file-link:hover {
    color: #60a5fa;
}

/* Modal footer */
.task-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.1);
    border-radius: 0 0 12px 12px;
}

.task-modal-footer-left,
.task-modal-footer-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.task-btn {
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.task-btn-save {
    background: #2563eb;
    color: #fff;
}
.task-btn-save:hover {
    background: #1d4ed8;
}

.task-btn-edit {
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
}
.task-btn-edit:hover {
    background: rgba(255,255,255,0.15);
}

.task-btn-close {
    background: rgba(255,255,255,0.06);
    color: #94a3b8;
}
.task-btn-close:hover {
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
}

.task-btn-done {
    background: #22c55e;
    color: #fff;
}
.task-btn-done:hover {
    background: #16a34a;
}

.task-btn-confirm {
    background: #16a34a;
    color: #fff;
}
.task-btn-confirm:hover {
    background: #15803d;
}

.task-btn-delete {
    background: #dc2626;
    color: #fff;
}
.task-btn-delete:hover {
    background: #b91c1c;
}

/* Scrollbar style for task columns */
.tasks-column-body::-webkit-scrollbar {
    width: 4px;
}
.tasks-column-body::-webkit-scrollbar-track {
    background: transparent;
}
.tasks-column-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}
.tasks-column-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

.task-attachments-list::-webkit-scrollbar {
    width: 4px;
}
.task-attachments-list::-webkit-scrollbar-track {
    background: transparent;
}
.task-attachments-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

/* ==============================
   STATUS: DO UZUPEŁNIENIA
   ============================== */
.task-status-uzupelnienie {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}
.task-card.task-status-uzupelnienie {
    border-left: 3px solid #f59e0b;
}

/* Badge w modal */
.task-modal-status-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 600;
}
.task-status-uzupelnienie-badge {
    background: rgba(245,158,11,0.2);
    color: #fbbf24;
    border: 1px solid rgba(245,158,11,0.3);
}
.task-status-zrobione-badge {
    background: rgba(34,197,94,0.2);
    color: #4ade80;
    border: 1px solid rgba(34,197,94,0.3);
}

/* ==============================
   PRZYCISK ODBIJ (bounce)
   ============================== */
.task-bounce-btn {
    background: #f59e0b;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.task-bounce-btn:hover {
    background: #d97706;
    transform: scale(1.05);
}

.task-btn-bounce {
    background: #f59e0b;
    color: #fff;
}
.task-btn-bounce:hover {
    background: #d97706;
}

/* ==============================
   KOMENTARZE
   ============================== */
.task-comments-container {
    max-height: 220px;
    overflow-y: auto;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.task-comments-container::-webkit-scrollbar {
    width: 4px;
}
.task-comments-container::-webkit-scrollbar-track {
    background: transparent;
}
.task-comments-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
}

.task-comments-empty,
.task-comments-loading {
    color: rgba(255,255,255,0.35);
    font-size: 12px;
    text-align: center;
    padding: 20px 10px;
}

.task-comment {
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    max-width: 85%;
}
.task-comment-mine {
    background: rgba(96,165,250,0.15);
    border: 1px solid rgba(96,165,250,0.2);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}
.task-comment-other {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}
.task-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    gap: 10px;
}
.task-comment-author {
    font-weight: 600;
    color: #93c5fd;
    font-size: 11px;
}
.task-comment-mine .task-comment-author {
    color: #60a5fa;
}
.task-comment-date {
    color: rgba(255,255,255,0.3);
    font-size: 10px;
    white-space: nowrap;
}
.task-comment-content {
    color: rgba(255,255,255,0.85);
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.task-comment-input-row {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}
.task-comment-input-row textarea {
    flex: 1;
    min-height: 36px;
    resize: vertical;
}
.task-btn-comment {
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    align-self: flex-end;
    height: 36px;
}
.task-btn-comment:hover {
    background: #2563eb;
}

/* ----- DIALOG ZAKOŃCZENIA ZADANIA ----- */
.task-done-dialog-overlay {
    z-index: 10001;
}
.task-done-dialog {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    overflow: hidden;
}
.task-done-dialog-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 14px;
    color: #e2e8f0;
}
.task-done-dialog-header strong {
    color: #fff;
}
.task-done-dialog-body {
    padding: 12px 16px;
}
.task-done-dialog-body textarea {
    width: 100%;
    box-sizing: border-box;
}
.task-done-dialog-footer {
    padding: 10px 16px 14px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
