.seat-menu,
.user-actions-menu {
    position: absolute;
    background: #222;
    padding: 8px 0;
    border-radius: 8px;
    color: #fff;
    width: 150px;
    z-index: 99999;
    text-align: center;
    box-shadow: 0 0 10px #000;
}

.menu-btn {
    padding: 8px;
    cursor: pointer;
}
.menu-btn:hover {
    background: #444;
}

/* =============================
        نافذة المقاعد
   ============================= */
.seats-popup {
    position: fixed;
    top: 70px; /* قربها من الشريط الأسود */
    left: 50%;
    transform: translateX(-50%);
    background: #000000d1;
    padding: 15px;
    border-radius: 12px;
    width: 320px;
    max-width: 90vw;
    max-height: 65vh;
    overflow: hidden;
    display: none;
    z-index: 9999;
    direction: rtl;
    text-align: right;
}

.seats-popup h3 {
    margin: 0 0 10px;
    text-align: center;
    color: #fff;
    font-size: 18px;
}

/* =============================
      حاوية المقاعد (صفوف)
   ============================= */
.seats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 22px 14px; /* ↑↑ زيادة المسافة بين الصفوف ↑↑ */
    justify-content: center;
    padding: 10px;
    background: #00000040;
    border-radius: 10px;
}

/* =============================
         شكل المقعد
   ============================= */
.seat {
    width: 60px;
    height: 60px;
    background-image: url("default_images/royal-chair.png");
    background-size: cover;
    background-position: center;
    position: relative;
    border-radius: 10px;
    cursor: pointer;
}

/* فارغ */
.seat.free {
    opacity: 0.7;
    border: 1px solid #666;
}

/* محجوز */
.seat.occupied {
    opacity: 1;
    border: 1px solid #2196F3;
}

/* =============================
  بيانات المستخدم داخل المقعد
   ============================= */
.seat .user-info {
    position: absolute;
    top: 50%;  /* في نص الكرسي */
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 44px;
}

.seat .user-info img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #eee;
}

.seat .user-info .name {
    display: block;
    font-size: 10px;
    margin-top: 3px;
    color: #fff;
    text-shadow: 0 0 3px #000;
}


/* =============================
      زر المايك (دائري)
   ============================= */
.mic-btn {
    position: absolute;
    top: -10px; 
    right: -10px;
    width: 28px;
    height: 28px;
    background: #222;
    color: #fff;
    font-size: 13px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 999;
    transition: 0.2s;
}

.mic-btn.mic-on {
    background: #28a745 !important;
}

.mic-btn.mic-off {
    background: #d63031 !important;
}

/* =============================
      قائمة أكشن المستخدم
   ============================= */
.user-actions-menu {
    position: absolute;
    bottom: 100%;                /* خليها فوق المقعد مباشرة */
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #222;
    color: white;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    padding: 6px 0;
    min-width: 120px;
    text-align: center;
    font-size: 12px;
    z-index: 20000;
}

.user-actions-menu div {
    padding: 8px 12px;
    cursor: pointer;
    white-space: nowrap;
}

.user-actions-menu div:hover {
    background: #ff4444;
}


/* =============================
       أزرار التحكم السفلية
   ============================= */
.seats-controls {
    text-align: center;
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.seats-controls button {
    padding: 6px 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

#close-seats {
    background: #f44336;
    color: #fff;
}

#close-seats:hover {
    background: #d32f2f;
}

#manage-seats {
    background: #FFD700;
    color: #000;
    font-weight: bold;
}

#manage-seats:hover {
    background: #e6b800;
}

/* =============================
        لوحة إدارة المقاعد
   ============================= */
.seat-admin-popup {
    background: #2c2c2c;
    color: #fff;
    width: 340px;
    border-radius: 10px;
    overflow: hidden;
    display: none;
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
}

.seat-admin-header {
    background: #1e1e1e;
    padding: 10px;
    display: flex;
    justify-content: space-between;
}

.seat-admin-header h3 {
    margin: 0;
    color: #FFD700;
    font-size: 16px;
}

#seat-admin-close {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
}

.admin-actions {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-actions button {
    background: #3a3a3a;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #555;
    font-weight: bold;
    cursor: pointer;
    color: #ffcc00;
}

.admin-actions button:hover {
    background: #4a4a4a;
}

/* =============================
          دعم الموبايل
   ============================= */
@media (max-width: 600px) {
    .seats-popup {
        width: 90vw;
        top: 60px;
    }

    .seat {
        width: 52px;
        height: 52px;
    }

    .seat .user-info img {
        width: 40px;
        height: 40px;
    }

    .mic-btn {
        width: 24px;
        height: 22px;
        top: -15px;
        right: -4px;
    }
}
/* Layout جديد على نظام TopTop... */
.seats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 22px 14px;
    justify-content: center;
    padding: 10px;
    background: #00000040;
    border-radius: 10px;
}
/* كتابة S1 / S2 ... فوق الكرسي */
.empty-seat-label {
    position: absolute;
    top: 3px;
    right: 5px;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 0 0 3px #000;
}

/* علامة + في نص المقعد */
.empty-seat-plus {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #000000aa;
    color: #0f0;
    border: 1px solid #2ecc71;
    font-size: 15px;
    line-height: 22px;
    text-align: center;
    font-weight: bold;
}
.seats-row-custom {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 12px;
}
.mute-btn {
    position: absolute;
    bottom: 40px;
    left: -8px;
    width: 22px;
    height: 22px;
    background: #444;
    color: #fff;
    font-size: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 999;
    transition: 0.2s;
}

.mute-btn:hover {
    background: #666;
}
/* VIP Seats (S1 - S2) */
.vip-seat {
    border: 2px solid #FFD700 !important;
    box-shadow: 0 0 12px #ffec87, 0 0 25px #ffcc00;
    background-image: url('default_images/royal-chair.png') !important;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* تاج VIP */
.vip-seat::after {
    content: "👑";
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 20px;
    text-shadow: 0 0 4px #000;
}
/* ===== صوت المتحدث: رينج وإضاءة حوالين الصورة ===== */
.seat .user-info.speaking::before {
    content: "";
    position: absolute;
    top: -4px;
    left: -4px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid rgba(0, 255, 0, 0.9); /* أخضر */
    box-shadow: 0 0 15px rgba(255, 230, 0, 0.6),
                0 0 25px rgba(255, 230, 0, 0.3);
    animation: talkingPulse 1s infinite ease-in-out;
    z-index: -1;
}

@keyframes talkingPulse {
    0%   { transform: scale(1);    opacity: 1; }
    100% { transform: scale(1.35); opacity: 0; }
}
/* =============================
   مؤشر حالة المايك فوق الصورة
   ============================= */

.mic-indicator {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #222;
    border: 1px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
    z-index: 5;
    box-shadow: 0 0 4px rgba(0,0,0,0.8);
}

.mic-indicator.mic-on {
    background: #28a745;   /* أخضر لما يكون المايك شغال */
}

.mic-indicator.mic-off {
    background: #d63031;   /* أحمر لما يكون المايك مقفول */
    opacity: 0.95;
}
/* منيو التحكم في المقعد */
.seat-menu {
    position: absolute;
    background: #1e1e1e;
    border-radius: 8px;
    padding: 6px 0;
    width: 150px;
    box-shadow: 0 0 12px rgba(0,0,0,0.6);
    z-index: 999999;
    text-align: center;
}

.seat-menu div {
    padding: 8px 12px;
    cursor: pointer;
    color: #fff;
    font-size: 13px;
}

.seat-menu div:hover {
    background: #444;
}

/* شكل المقعد المقفول */
.seat.locked-seat {
    opacity: 0.4 !important;
    filter: grayscale(100%);
}

/* شكل المقعد المكتوم */
.seat.muted-seat .mic-indicator {
    background: #555 !important;
    border-color: #999;
    opacity: 0.5;
}

