/* ============================================================
   Mass Analytica – Frontend Kanban Board
   ============================================================ */

/* Board wrapper */
.ma-board {
    margin: 2em 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}
.ma-board-title {
    font-size: 1.6em;
    margin-bottom: 0.2em;
}
.ma-board-desc {
    color: #666;
    margin-bottom: 1em;
}

/* Columns grid */
.ma-columns {
    display: grid;
    grid-template-columns: repeat(var(--ma-col-count, 3), 1fr);
    gap: 16px;
    align-items: stretch;
}

@media (max-width: 768px) {
    .ma-columns {
        grid-template-columns: 1fr;
    }
}

/* Single column */
.ma-column {
    background: #f4f5f7;
    border-radius: 8px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
}

.ma-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px 8px;
    font-weight: 600;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #5e6c84;
}

.ma-column-count {
    background: #dfe1e6;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    color: #5e6c84;
}

/* Task list inside column */
.ma-task-list {
    flex: 1;
    padding: 4px 8px 8px;
    min-height: 60px;
}

/* Task card */
.ma-task-card {
    background: #fff;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    border-left: 4px solid #0073aa;
    transition: box-shadow 0.15s, transform 0.15s;
    position: relative;
}
.ma-task-card:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
}

/* Label pills */
.ma-label-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    line-height: 1.4;
}
.ma-label-pill .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
    line-height: 12px;
}
.ma-label-pill-sm {
    font-size: 10px;
    padding: 1px 6px;
}
.ma-label-pill-sm .dashicons {
    font-size: 11px;
    width: 11px;
    height: 11px;
    line-height: 11px;
}

/* Labels row on card – positioned at top-right */
.ma-task-labels {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: flex-end;
    max-width: 60%;
}

/* Labels in modal */
.ma-modal-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

    .ma-modal-short-desc {
        font-size: 0.95em;
        color: #5e6c84;
        font-style: italic;
        margin: 0 0 10px;
        padding-bottom: 10px;
        border-bottom: 1px solid #ebecf0;
    }

/* ── Quick-add task ─────────────────────────────────────── */
.ma-quick-add {
    padding: 4px 8px 8px;
}

.ma-quick-add-btn {
    display: block;
    width: 100%;
    padding: 6px;
    border: 2px dashed #c4c9d4;
    border-radius: 6px;
    background: none;
    color: #6b778c;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.ma-quick-add-btn:hover {
    border-color: #0073aa;
    color: #0073aa;
}

.ma-quick-add-form {
    background: #fff;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.ma-quick-add-input {
    display: block;
    width: 100%;
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 0.9em;
    margin-bottom: 6px;
    box-sizing: border-box;
}
.ma-quick-add-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.ma-quick-add-actions {
    display: flex;
    gap: 6px;
}

.ma-quick-add-save {
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 14px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.ma-quick-add-save:hover {
    background: #005a87;
}
.ma-quick-add-save:disabled {
    opacity: 0.6;
    cursor: wait;
}

.ma-quick-add-cancel {
    background: none;
    border: none;
    font-size: 1.2em;
    color: #6b778c;
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
}
.ma-quick-add-cancel:hover {
    color: #de350b;
}

.ma-task-title {
    font-weight: 600;
    font-size: 0.95em;
    color: #172b4d;
    margin-bottom: 4px;
}
    .ma-task-short-desc {
        font-size: 0.82em;
        color: #5e6c84;
        line-height: 1.4;
        margin-bottom: 4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .ma-task-desc {
    font-size: 0.85em;
    color: #6b778c;
    line-height: 1.4;
    margin-bottom: 6px;
}
.ma-task-meta {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Priority badges */
.ma-priority-badge-low {
    background: #dfe1e6;
    color: #5e6c84;
}
.ma-priority-badge-normal {
    background: #deebff;
    color: #0052cc;
}
.ma-priority-badge-high {
    background: #fff0b3;
    color: #ff8b00;
}
.ma-priority-badge-urgent {
    background: #ffebe6;
    color: #de350b;
}

.ma-task-priority {
    font-size: 0.75em;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Priority card borders */
.ma-priority-low    { border-left-color: #b3bac5; }
.ma-priority-normal { border-left-color: #0073aa; }
.ma-priority-high   { border-left-color: #ff8b00; }
.ma-priority-urgent { border-left-color: #de350b; }

/* Error state */
.ma-error {
    color: #de350b;
    font-style: italic;
}

/* ── Modal / Dialog ─────────────────────────────────────────── */
.ma-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}
.ma-modal-overlay.ma-visible {
    opacity: 1;
    visibility: visible;
}

.ma-modal {
    position: fixed;
    z-index: 99999;
    top: 50%;
    left: 50%;
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) perspective(800px) rotateY(-90deg);
    transform-origin: center center;
    transition: opacity 0.45s cubic-bezier(.4,0,.2,1),
                visibility 0.45s,
                transform 0.45s cubic-bezier(.2,.9,.3,1.2);
}
.ma-modal.ma-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) perspective(800px) rotateY(0deg);
}

.ma-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.6em;
    cursor: pointer;
    color: #6b778c;
    line-height: 1;
}
.ma-modal-close:hover {
    color: #172b4d;
}

.ma-modal-body {
    padding: 28px 24px 24px;
}

.ma-modal-title {
    font-size: 1.3em;
    margin: 0 0 12px;
    color: #172b4d;
}

.ma-modal-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}

.ma-modal-status {
    background: #f4f5f7;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 600;
    color: #5e6c84;
    text-transform: uppercase;
}

.ma-modal-edit {
    font-size: 0.8em;
    font-weight: 600;
    color: #2271b1;
    background: none;
    border: 1px solid #2271b1;
    border-radius: 4px;
    padding: 2px 10px;
    cursor: pointer;
    margin-left: auto;
    text-decoration: none;
}
.ma-modal-edit:hover {
    background: #2271b1;
    color: #fff;
}

/* ── Edit iframe modal ───────────────────────────────────────── */
.ma-edit-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}
.ma-edit-overlay.ma-visible {
    opacity: 1;
    visibility: visible;
}

.ma-edit-modal {
    position: fixed;
    z-index: 100001;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
    background: #fff;
    border-radius: 10px;
    width: 92%;
    max-width: 900px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transition: opacity 0.35s cubic-bezier(.4,0,.2,1),
                visibility 0.35s,
                transform 0.35s cubic-bezier(.4,0,.2,1);
}
.ma-edit-modal.ma-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
}

.ma-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid #e2e4ea;
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
}
.ma-edit-header-title {
    font-weight: 600;
    font-size: 1em;
    color: #172b4d;
}
.ma-edit-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #6b778c;
    line-height: 1;
}
.ma-edit-close:hover {
    color: #172b4d;
}

.ma-edit-iframe {
    flex: 1;
    width: 100%;
    border: none;
}

.ma-modal-desc {
    font-size: 0.95em;
    line-height: 1.6;
    color: #333;
}
.ma-modal-desc img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 8px 0;
}
.ma-modal-desc p {
    margin: 0 0 0.8em;
}
.ma-modal-desc ul,
.ma-modal-desc ol {
    margin: 0 0 0.8em 1.5em;
}
