/* =========================================================
   LPJ MODAL - Projects / My Projects
   File: public/assets/css/modal.css
   ========================================================= */

.project-action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Overlay */
.lpj-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    width: 100%;
    height: 100%;
    padding: 24px;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

/* Active state */
.lpj-modal-overlay.is-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Prevent background scroll */
body.lpj-modal-open {
    overflow: hidden;
}

/* Modal panel */
.lpj-modal {
    width: min(1120px, 100%);
    max-height: 90vh;
    overflow: hidden;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
    animation: lpjModalIn 160ms ease-out;
}

@keyframes lpjModalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Form layout */
.lpj-modal-form {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

/* Header */
.lpj-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 26px 18px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.lpj-modal-title {
    margin: 0;
    font-size: 20px;
    line-height: 1.35;
    font-weight: 700;
    color: #0f172a;
}

.lpj-modal-score {
    display: inline-flex;
    align-items: center;
    margin: 10px 0 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e3a8a;
    font-size: 13px;
    font-weight: 700;
}

/* X close button */
.lpj-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.lpj-modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: rotate(90deg);
}

/* Body */
.lpj-modal-body {
    padding: 20px 26px;
    overflow-y: auto;
}

/* Table */
.lpj-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
}

.lpj-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
    font-size: 14px;
}

.lpj-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 13px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.lpj-table tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf2f7;
    color: #0f172a;
    vertical-align: middle;
}

.lpj-table tbody tr:last-child td {
    border-bottom: none;
}

.lpj-table tbody tr:hover {
    background: #f8fafc;
}

.lpj-table th:first-child,
.lpj-table td:first-child {
    width: 64px;
    text-align: center;
}

.lpj-table th:nth-child(3),
.lpj-table th:nth-child(4),
.lpj-table th:nth-child(5),
.lpj-table td:nth-child(3),
.lpj-table td:nth-child(4),
.lpj-table td:nth-child(5) {
    width: 150px;
    text-align: center;
}

.lpj-document-name {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: #111827;
}

.lpj-row-unavailable {
    background: #fafafa;
}

.lpj-row-unavailable .lpj-document-name {
    color: #991b1b;
}

/* Checkbox */
.lpj-checkbox-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 112px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.lpj-checkbox-label:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.lpj-checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #2563eb;
    cursor: pointer;
}

.lpj-checkbox:disabled {
    cursor: not-allowed;
}

.lpj-checkbox-label:has(.lpj-checkbox:checked) {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.lpj-checkbox-label:has(.lpj-checkbox:disabled) {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Footer */
.lpj-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 26px 22px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

/* Responsive */
@media (max-width: 768px) {
    .lpj-modal-overlay {
        padding: 14px;
        align-items: flex-start;
    }

    .lpj-modal-overlay.is-active {
        align-items: flex-start;
        justify-content: center;
    }

    .lpj-modal {
        width: 100%;
        max-height: none;
        margin-top: 12px;
        border-radius: 14px;
    }

    .lpj-modal-form {
        max-height: none;
    }

    .lpj-modal-header,
    .lpj-modal-body,
    .lpj-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .lpj-modal-title {
        font-size: 17px;
    }

    .lpj-modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .lpj-modal-footer .btn {
        width: 100%;
    }
}

/* LPJ button state */
.lpj-button {
    font-weight: 700;
    white-space: nowrap;
}

.lpj-button--empty {
    background: #475569;
    border-color: #475569;
    color: #ffffff;
}

.lpj-button--progress {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.lpj-button--complete {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
}

/* Flash message */
.page-flash {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.page-flash--success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.page-flash--error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.lpj-document-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lpj-document-view-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.lpj-document-view-link:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
    text-decoration: none;
}