/* =====================================================
   GymLog — فرم حرکت (ee-) و کارت‌های بانک حرکات
===================================================== */

/* ---------- بانک حرکات ---------- */
.dv-bank-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.dv-bank-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dv-bank-search {
    width: 240px;
    height: 42px;
}

.dv-bank-add {
    min-height: 42px;
    padding: 8px 18px;
    white-space: nowrap;
}

.dv-bank-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dv-bank-card .dv-bank-item {
    flex: 1;
    position: relative;
}

.dv-bank-badge {
    padding: 1px 8px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8 !important;
    font-size: 10px !important;
    direction: rtl !important;
}

.dv-bank-none {
    display: none;
    padding: 24px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}

/* ---------- فرم ---------- */
.ee-overlay {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 24, 39, 0.6);
}

.ee-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 680px;
    max-height: 92vh;
    border-radius: 16px;
    background: #ffffff;
    overflow: hidden;
}

.ee-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid #f3f4f6;
}

.ee-head h3 {
    margin: 0;
    font-size: 18px;
    color: #111827;
}

.ee-head p {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.8;
    color: #6b7280;
}

.ee-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ee-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 640px) {
    .ee-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.ee-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ee-field > span {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.ee-field > span b {
    color: #dc2626;
}

.ee-field small,
.ee-check small {
    font-size: 11px;
    line-height: 1.8;
    color: #9ca3af;
}

.ee-field input[readonly] {
    background: #f3f4f6;
    color: #6b7280;
}

.ee-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.9;
    color: #1f2937;
    resize: vertical;
}

.ee-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.ee-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}

.ee-check input {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.ee-check small {
    display: block;
}

.ee-media {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}

.ee-media-empty {
    grid-column: 1 / -1;
    padding: 18px;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}

.ee-media-item {
    position: relative;
    height: 96px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f3f4f6;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #9ca3af;
}

.ee-media-item img,
.ee-media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ee-media-item em {
    position: absolute;
    bottom: 4px;
    right: 4px;
    left: 4px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(17, 24, 39, 0.75);
    color: #ffffff;
    font-size: 10px;
    font-style: normal;
    direction: ltr;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ee-media-item button {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 26px;
    height: 26px;
    min-height: 26px;
    padding: 0;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.8);
    color: #ffffff;
    font-size: 16px;
    line-height: 1;
}

.ee-upload {
    align-self: flex-start;
    padding: 8px 16px;
}

.ee-error {
    min-height: 20px;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.8;
    color: #b91c1c;
}

.ee-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid #f3f4f6;
}

.ee-foot .primary-btn {
    min-width: 150px;
}

.ee-foot .danger-btn {
    margin-right: auto;
}

/* ---------- Dark mode ---------- */
body.dark-mode .dv-bank-badge {
    background: #1e3a8a;
    color: #bfdbfe !important;
}

body.dark-mode .ee-modal {
    background: #1e293b;
}

body.dark-mode .ee-head,
body.dark-mode .ee-foot {
    border-color: #334155;
}

body.dark-mode .ee-head h3,
body.dark-mode .ee-field > span,
body.dark-mode .ee-check {
    color: #f3f4f6;
}

body.dark-mode .ee-head p,
body.dark-mode .dv-bank-none {
    color: #94a3b8;
}

body.dark-mode .ee-field textarea {
    background: #111827;
    border-color: #4b5563;
    color: #f3f4f6;
}

body.dark-mode .ee-field input[readonly] {
    background: #0f172a;
    color: #94a3b8;
}

body.dark-mode .ee-check {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .ee-media-item,
body.dark-mode .ee-media-empty {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .ee-error {
    color: #fca5a5;
}

.dv-bank-export {
    min-height: 42px;
    padding: 8px 14px;
    font-size: 12.5px;
    direction: ltr;
}

.exercise-guide-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.exercise-guide-actions button {
    flex: 1;
}
