﻿/* ============================================
   Dark Theme Refinements
   ============================================ */

/* Scrollbar â€” refined */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #383838; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555555; }

/* Timeline header refinements */
.timeline-header { background: #1d1d1d; }
.timeline-header input[type="number"] { background: #222; color: #fff; }
select option { background: #1a1a1a; color: #ffffff; }

/* No text-shadow globally */
* { text-shadow: none !important; }

/* â•â•â•â•â•â•â• 3D Floor Grid Panel â•â•â•â•â•â•â• */
#floorGrid3DGroup .group-header {
    font-weight: 700;
    letter-spacing: 0.3px;
}
#floorGrid3DGroup .group-content {
    background: rgba(6, 182, 212, 0.03);
    border-bottom: 1px solid rgba(6, 182, 212, 0.15);
}
#floorGrid3DGroup input[type="range"] {
    accent-color: #06b6d4;
}
#floorGrid3DGroup input[type="checkbox"] {
    accent-color: #06b6d4;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   9. RemoteMotionPad (Ù„ÙˆØ­ Ø§Ù„ØªØ­Ø±ÙŠÙƒ Ø¹Ù† Ø¨Ø¹Ø¯)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.blend-pads-list {
    max-height: 700px;
    overflow-y: auto;
    padding: 5px 0;
}

.remote-pad-empty {
    text-align: center;
    color: var(--text-dim);
    font-size: 11px;
    padding: 15px 10px;
    line-height: 1.6;
}

.remote-pad-item {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin: 5px 10px;
    padding: 8px 10px;
    position: relative;
    transition: border-color 0.15s;
}
.remote-pad-item:hover {
    border-color: #22c55e44;
}

/* â”€â”€â”€ Header â”€â”€â”€ */
.remote-pad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 4px;
}

.remote-pad-name {
    flex: 1;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 2px 4px;
    border-radius: 3px;
}
.remote-pad-name:hover {
    background: var(--bg-hover);
}

.remote-pad-controls {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}
.remote-pad-controls button {
    width: 20px;
    height: 20px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text-dim);
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
}
.remote-pad-controls button:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
    border-color: var(--border-light);
}

/* â”€â”€â”€ Pad Canvas (2D Control) â”€â”€â”€ */
.remote-pad-canvas-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 8px 0;
}

.remote-pad-canvas {
    position: relative;
    background: radial-gradient(circle at center, #1a2e1a 0%, #16213e 60%, #1a1a2e 100%);
    border: 2px solid #2d4a2d;
    cursor: crosshair;
    overflow: hidden;
    box-shadow: inset 0 0 25px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
    transition: border-color 0.2s, box-shadow 0.2s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.remote-pad-canvas:hover {
    border-color: #22c55e;
}
.remote-pad-canvas.active {
    border-color: #4ade80;
    box-shadow: inset 0 0 25px rgba(0,0,0,0.5), 0 0 16px rgba(34, 197, 94, 0.4);
}

/* Cross-hair guides */
.remote-pad-cross-h {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(34, 197, 94, 0.15);
    pointer-events: none;
}
.remote-pad-cross-v {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(34, 197, 94, 0.15);
    pointer-events: none;
}

/* Direction arrows overlay */
.remote-pad-arrows {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

/* Handle (draggable circle) */
.remote-pad-handle {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #86efac, #22c55e);
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.6), 0 2px 4px rgba(0,0,0,0.4);
    transform: translate(-50%, -50%);
    cursor: grab;
    transition: box-shadow 0.15s;
    z-index: 5;
    pointer-events: none;
}
.remote-pad-handle.dragging {
    cursor: grabbing;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.9), 0 0 40px rgba(34, 197, 94, 0.4);
    background: radial-gradient(circle at 35% 35%, #bbf7d0, #4ade80);
}

/* Motion type label */
.remote-pad-motion-label {
    font-size: 9px;
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(34, 197, 94, 0.08);
    text-align: center;
}

/* Coordinate display */
.remote-pad-coord {
    text-align: center;
    font-size: 10px;
    color: #888;
    font-family: monospace;
    margin: 2px 0 6px;
    letter-spacing: 0.5px;
}

/* â”€â”€â”€ Motion Type Section â”€â”€â”€ */
.remote-pad-motion-section {
    border-top: 1px solid var(--border);
    padding-top: 6px;
    margin-top: 4px;
    margin-bottom: 6px;
}

.remote-pad-section-header {
    font-size: 10px;
    color: #4ade80;
    margin-bottom: 4px;
    font-weight: 600;
}

.remote-pad-motion-select {
    width: 100%;
    font-size: 10px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-main);
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 4px;
}

.remote-pad-strength-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    color: var(--text-dim);
}
.remote-pad-strength-row label {
    white-space: nowrap;
    flex-shrink: 0;
}
.remote-pad-strength-range {
    flex: 1;
    height: 14px;
    accent-color: #22c55e;
    cursor: pointer;
}
.remote-pad-strength-val {
    font-size: 9px;
    color: #4ade80;
    min-width: 30px;
    text-align: center;
    font-family: monospace;
}

/* â”€â”€â”€ Assignment Section â”€â”€â”€ */
.remote-pad-assign-section {
    border-top: 1px solid var(--border);
    padding-top: 6px;
    margin-top: 4px;
}

.remote-pad-assign-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 10px;
    color: var(--text-dim);
}

.remote-pad-add-shape-btn {
    font-size: 9px;
    padding: 2px 8px;
    border: 1px solid #22c55e;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}
.remote-pad-add-shape-btn:hover {
    background: rgba(34, 197, 94, 0.25);
}

.remote-pad-assign-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.remote-pad-no-assign {
    text-align: center;
    font-size: 10px;
    color: #555;
    padding: 6px;
    line-height: 1.5;
}

.remote-pad-assign-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px;
    border-radius: 4px;
    background: rgba(34, 197, 94, 0.03);
    font-size: 10px;
}
.remote-pad-assign-item:hover {
    background: rgba(34, 197, 94, 0.08);
}

.remote-pad-assign-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.remote-pad-assign-name {
    flex: 1;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    min-width: 0;
}

.remote-pad-axis-select {
    width: 38px;
    font-size: 9px;
    padding: 1px 2px;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-main);
    border-radius: 3px;
    cursor: pointer;
}

.remote-pad-invert-btn {
    width: 18px;
    height: 18px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text-dim);
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}
.remote-pad-invert-btn.active {
    background: rgba(34, 197, 94, 0.3);
    border-color: #22c55e;
    color: #86efac;
}

.remote-pad-weight-range {
    width: 40px;
    height: 12px;
    accent-color: #22c55e;
    cursor: pointer;
}

.remote-pad-remove-btn {
    width: 16px;
    height: 16px;
    border: none;
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.5;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.remote-pad-remove-btn:hover {
    opacity: 1;
}

/* â”€â”€â”€ Info Section â”€â”€â”€ */
.remote-pad-info {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(34, 197, 94, 0.1);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   HISTORY PANEL STYLES (moved from inline in index.html)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
#historyList .history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    margin: 1px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 11px;
    border-left: 3px solid transparent;
}
#historyList .history-item:hover {
    background: var(--bg-hover, #252540);
}
#historyList .history-item.current {
    background: linear-gradient(90deg, #a78bfa22, transparent);
    border-left-color: #a78bfa;
    font-weight: 600;
}
#historyList .history-item.future {
    opacity: 0.4;
}
#historyList .history-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-main, #e0e0e0);
}
#historyList .history-item.current .history-label {
    color: #a78bfa;
}
#historyList .history-time {
    flex-shrink: 0;
    font-size: 10px;
    color: var(--text-dim, #888);
    margin-right: 8px;
    font-family: monospace;
}

/* ============================================
   PROFILE BUTTON (Header)
   ============================================ */
.profile-trigger-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(212, 168, 67, 0.08);
    border: 1px solid rgba(212, 168, 67, 0.25);
    border-radius: 20px;
    padding: 3px 10px 3px 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main, #e0e0e0);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.profile-trigger-btn:hover {
    background: rgba(212, 168, 67, 0.18);
    border-color: #d4a843;
}
.profile-trigger-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* ============================================
   PROFILE MODAL
   ============================================ */
.pm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.pm-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.pm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    width: 340px;
    max-height: 90vh;
    background: #101218;
    border: 1px solid rgba(212, 168, 67, 0.25);
    border-radius: 16px;
    z-index: 99999;
    padding: 28px 24px 20px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    font-family: 'Segoe UI', Tahoma, sans-serif;
    /* الاتجاه يُضبط ديناميكياً عبر JS بناءً على لغة الواجهة (ar=rtl, en=ltr) */
    direction: rtl;
}
/* وضع الإنجليزية: LTR */
.pm-modal[dir="ltr"] {
    direction: ltr;
    text-align: left;
}
.pm-modal[dir="ltr"] .pm-close {
    left: auto;
    right: 12px;
}
.pm-modal[dir="ltr"] .pm-menu-item {
    text-align: left;
}
.pm-modal[dir="ltr"] .pm-menu-label {
    text-align: left;
}
.pm-modal.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.pm-close {
    position: absolute;
    top: 10px;
    left: 12px;
    background: none;
    border: none;
    color: #888;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
}
.pm-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* Avatar + Name */
.pm-header {
    text-align: center;
    margin-bottom: 20px;
}
.pm-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid #d4a843;
    margin-bottom: 10px;
    object-fit: cover;
}
.pm-name {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}
.pm-email {
    font-size: 12px;
    color: #888;
}

/* Subscription Card */
.pm-sub-card {
    background: rgba(212, 168, 67, 0.06);
    border: 1px solid rgba(212, 168, 67, 0.15);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.pm-sub-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.pm-sub-row + .pm-sub-row {
    margin-top: 8px;
}
.pm-sub-label {
    color: #aaa;
}
.pm-badge {
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.pm-badge-free {
    background: rgba(100, 100, 100, 0.2);
    color: #aaa;
}
.pm-badge-pro {
    background: rgba(212, 168, 67, 0.18);
    color: #d4a843;
    border: 1px solid rgba(212, 168, 67, 0.3);
}
.pm-badge-yearly {
    background: rgba(99, 102, 241, 0.18);
    color: #a78bfa;
    border: 1px solid rgba(99, 102, 241, 0.3);
}
.pm-expire {
    color: #ccc;
    font-size: 12px;
}

/* Menu */
.pm-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}
.pm-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.15s;
    color: #ddd;
    font-size: 13px;
    text-align: right;
}
.pm-menu-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.08);
}
.pm-menu-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
}
/* v3.9.7: أيقونات SVG على نمط موقع Anima Studio (خطية، ذهبية) */
.pm-menu-icon svg,
.pm-sub-label svg {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: inline-block;
}
.pm-menu-icon svg {
    width: 18px;
    height: 18px;
    color: var(--gold, #d4a843);
    vertical-align: middle;
}
.pm-sub-label svg {
    color: var(--gold, #d4a843);
    margin-inline-end: 6px;
}
.pm-logout .pm-menu-icon svg {
    color: #ff8b8b;
}
.pm-menu-label {
    flex: 1;
}
.pm-menu-badge {
    background: rgba(99, 102, 241, 0.15);
    color: #a78bfa;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 8px;
    font-weight: 600;
}
.pm-menu-arrow {
    width: 14px;
    height: 14px;
    color: #666;
}
.pm-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 8px 0;
}
.pm-logout {
    color: #ef4444 !important;
}
.pm-logout:hover {
    background: rgba(239, 68, 68, 0.08) !important;
    border-color: rgba(239, 68, 68, 0.15) !important;
}
