:root {
    --ds-background-neutral: #091e420f;
    --ds-surface: #ffffff;
    --ds-text: #172b4d;
    --pm-blue: #0c66e4;
}

#wp-pm-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Vazirmatn", sans-serif;
    direction: rtl;
    height: calc(100vh - 50px);
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* Header */
.pm-navbar {
    background: #ffffff;
    padding: 10px 20px;
    border-bottom: 1px solid #dfe1e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pm-navbar h1 { font-size: 18px; margin: 0; display: flex; align-items: center; gap: 8px; color: var(--ds-text); }
#board-selector { min-width: 200px; }

/* Canvas (The Board) */
.pm-board-canvas {
    flex-grow: 1;
    background-color: #89609e; /* Trello Purple style background */
    background-image: linear-gradient(135deg, #89609e 0%, #4f46e5 100%);
    padding: 12px;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    align-items: flex-start;
}

.pm-loading-screen { color: white; font-size: 18px; padding: 20px; }

/* Lists */
.pm-list-wrapper {
    width: 272px;
    min-width: 272px;
    height: 100%;
    box-sizing: border-box;
    display: inline-block;
    vertical-align: top;
    white-space: nowrap;
}

.pm-list-content {
    background-color: #f1f2f4;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    position: relative;
    padding-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.pm-list-header {
    padding: 10px 12px;
    font-weight: 600;
    color: #172b4d;
    cursor: pointer;
}
.pm-list-header h3 { margin: 0; font-size: 14px; padding: 5px 0; }

.pm-cards-area {
    padding: 0 8px;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 20px;
}

/* Cards */
.pm-card {
    background-color: var(--ds-surface);
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(9, 30, 66, 0.25), 0 0 0 1px rgba(9, 30, 66, 0.08);
    cursor: pointer;
    display: block;
    margin-bottom: 8px;
    max-width: 300px;
    min-height: 20px;
    position: relative;
    padding: 8px 12px;
    text-decoration: none;
    z-index: 0;
    transition: background 0.1s;
    white-space: normal;
}
.pm-card:hover { background-color: #f8f9fa; border-color: #091e4224; }
.pm-card-ghost { background: #e4e6ea; opacity: 0.5; } /* Dragging placeholder */

.pm-card-title { color: #172b4d; font-size: 14px; line-height: 20px; margin-bottom: 4px; }

.pm-card-meta { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 6px; }
.badge-date { 
    font-size: 11px; 
    color: #5e6c84; 
    background: #0000000a; 
    padding: 2px 4px; 
    border-radius: 3px; 
    display: flex; align-items: center; gap: 2px;
}
.card-avatar { width: 24px; height: 24px; border-radius: 50%; }

/* Add Card Button */
.pm-list-footer { padding: 0 8px; }
.btn-add-card { 
    background: transparent; border: none; border-radius: 4px; 
    color: #5e6c84; width: 100%; text-align: right; 
    padding: 6px 8px; cursor: pointer; 
}
.btn-add-card:hover { background-color: #091e4214; color: #172b4d; }

.add-card-form textarea { width: 100%; border: none; box-shadow: 0 1px 2px rgba(0,0,0,0.2); padding: 8px; border-radius: 4px; resize: vertical; margin-bottom: 5px; min-height: 60px; }
.form-actions { display: flex; align-items: center; gap: 5px; }

/* Add List Button */
.pm-add-list-wrapper { min-width: 272px; padding: 0 5px; }
.pm-add-list-wrapper button { width: 100%; background: #ffffff3d; color: #fff; border: none; text-align: right; font-weight: bold; }
.pm-add-list-wrapper button:hover { background: #ffffff52; }

/* Modal */
.pm-modal {
    position: fixed; inset: 0; background: #000000a3; z-index: 99999;
    display: none; align-items: center; justify-content: center;
}
.pm-modal-content {
    background: #f4f5f7; width: 768px; max-height: 90vh; border-radius: 2px;
    padding: 20px; position: relative; display: flex; flex-direction: column;
}
.close-modal { position: absolute; left: 15px; top: 15px; font-size: 24px; cursor: pointer; color: #42526e; }
.close-modal:hover { color: #172b4d; }

.modal-body-grid { display: flex; gap: 20px; overflow-y: auto; }
.modal-main { flex: 3; }
.modal-sidebar { flex: 1; display: flex; flex-direction: column; gap: 15px; }

/* Modal Elements */
.modal-main h2 { margin-top: 0; font-size: 20px; line-height: 24px; color: #172b4d; padding: 5px; border-radius: 3px; }
.modal-main h2:focus { background: #fff; box-shadow: inset 0 0 0 2px #4c9aff; outline: none; }

.meta-section { margin-bottom: 25px; }
.meta-section label, .modal-sidebar label { font-size: 12px; font-weight: 600; color: #5e6c84; display: block; margin-bottom: 4px; }
textarea#m-card-desc { background: #091e420a; border: none; min-height: 100px; width: 100%; padding: 10px; border-radius: 3px; margin-bottom: 10px; }
textarea#m-card-desc:focus { background: #fff; box-shadow: inset 0 0 0 2px #4c9aff; }

/* Comments */
.comment-row { display: flex; gap: 10px; margin-bottom: 15px; }
.comment-row img { width: 32px; height: 32px; border-radius: 50%; }
.c-bubble { background: #fff; padding: 8px 12px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); flex: 1; }
.c-bubble strong { font-size: 12px; color: #172b4d; display: block; margin-bottom: 4px; }
.c-bubble p { margin: 0; font-size: 14px; }