/* ─── Shahsara Notification & Invite System Styles ─── */

/* 1. Global In-App Floating Top Banner */
#shahsara-invite-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-150%);
  width: 92%;
  max-width: 520px;
  z-index: 2147483645;
  background: linear-gradient(135deg, rgba(12, 38, 24, 0.98) 0%, rgba(5, 20, 12, 0.98) 100%);
  border: 1.5px solid #D4AF37;
  border-radius: 18px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.75), 0 0 18px rgba(212, 175, 55, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  direction: rtl;
  font-family: -apple-system, BlinkMacSystemFont, "Vazirmatn", "Segoe UI", Roboto, Tahoma, sans-serif;
  padding: 12px 14px;
  color: #FFF;
  box-sizing: border-box;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}
#shahsara-invite-banner.banner-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.shahsara-ib-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.shahsara-ib-avatar-box {
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}
.shahsara-ib-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid #D4AF37;
  object-fit: cover;
  background: #06160D;
}
.shahsara-ib-game-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #D4AF37;
  color: #120900;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  border: 1.5px solid #06160D;
}
.shahsara-ib-content {
  flex: 1;
  min-width: 0;
}
.shahsara-ib-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #FFE082;
  margin: 0 0 3px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shahsara-ib-subtitle {
  font-size: 12px;
  color: #C8E6C9;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shahsara-ib-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.shahsara-ib-btn {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform 0.15s, background 0.15s;
}
.shahsara-ib-btn:active {
  transform: scale(0.94);
}
.shahsara-ib-btn-accept {
  background: linear-gradient(135deg, #FFE082 0%, #D4AF37 100%);
  color: #150E00;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}
.shahsara-ib-btn-reject {
  background: rgba(239, 83, 80, 0.2);
  color: #FF8A80;
  border: 1px solid rgba(239, 83, 80, 0.4);
}
.shahsara-ib-progress {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: rgba(212, 175, 55, 0.2);
  border-radius: 0 0 18px 18px;
  overflow: hidden;
}
.shahsara-ib-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #FFE082, #D4AF37);
  width: 100%;
  transition: width 0.1s linear;
}

/* 2. Generic Modal Overlay */
.shahsara-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  direction: rtl;
  font-family: -apple-system, BlinkMacSystemFont, "Vazirmatn", "Segoe UI", Roboto, Tahoma, sans-serif;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.shahsara-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.shahsara-dialog-card {
  max-width: 420px;
  width: 100%;
  background: linear-gradient(135deg, #0A2416 0%, #05150C 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.65);
  border-radius: 22px;
  padding: 24px 22px;
  color: #FFF;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.85), 0 0 24px rgba(212, 175, 55, 0.2);
  text-align: center;
  animation: shahsaraPop 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}
@keyframes shahsaraPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 3. Notification Permission Modal Specifics */
.shahsara-perm-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.25) 0%, rgba(212, 175, 55, 0.05) 70%);
  border: 1.5px solid #D4AF37;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px auto;
  font-size: 28px;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.35);
}
.shahsara-dialog-title {
  font-size: 17px;
  font-weight: 900;
  color: #FFE082;
  margin: 0 0 10px 0;
}
.shahsara-perm-list {
  text-align: right;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 14px 0 18px 0;
}
.shahsara-perm-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: #E0E0E0;
  line-height: 1.5;
  margin-bottom: 8px;
}
.shahsara-perm-item:last-child {
  margin-bottom: 0;
}
.shahsara-perm-item-icon {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}
.shahsara-dialog-btns {
  display: flex;
  gap: 10px;
}
.shahsara-btn-full {
  flex: 1;
  padding: 12px 0;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform 0.15s, opacity 0.15s;
}
.shahsara-btn-full:active {
  transform: scale(0.96);
}
.shahsara-btn-gold {
  background: linear-gradient(135deg, #FFE082 0%, #D4AF37 100%);
  color: #150E00;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}
.shahsara-btn-dim {
  background: rgba(255, 255, 255, 0.08);
  color: #BBB;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* 4. Active Game Warning Modal */
.shahsara-warning-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 83, 80, 0.3) 0%, rgba(239, 83, 80, 0.05) 70%);
  border: 1.5px solid #EF5350;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px auto;
  font-size: 30px;
  box-shadow: 0 0 16px rgba(239, 83, 80, 0.4);
}
.shahsara-warning-text {
  font-size: 13px;
  line-height: 1.7;
  color: #FFCDD2;
  background: rgba(183, 28, 28, 0.15);
  border: 1px dashed rgba(239, 83, 80, 0.4);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 14px 0 18px 0;
  text-align: right;
}
.shahsara-btn-danger {
  background: linear-gradient(135deg, #EF5350 0%, #C62828 100%);
  color: #FFF;
  box-shadow: 0 4px 14px rgba(239, 83, 80, 0.35);
}

/* 5. Invite Friends Modal */
.shahsara-friends-modal-box {
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.shahsara-friends-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.shahsara-friends-close {
  background: transparent;
  border: none;
  color: #AAA;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}
.shahsara-friends-search {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #FFF;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  margin-bottom: 12px;
}
.shahsara-friends-search:focus {
  border-color: #D4AF37;
}
.shahsara-friends-list {
  flex: 1;
  overflow-y: auto;
  max-height: 340px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}
.shahsara-friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 12px;
  transition: background 0.15s;
}
.shahsara-friend-row:hover {
  background: rgba(212, 175, 55, 0.08);
}
.shahsara-fr-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.shahsara-fr-avatar-box {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}
.shahsara-fr-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #D4AF37;
  object-fit: cover;
  background: #081B10;
}
.shahsara-online-dot {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #0A2416;
}
.shahsara-online-dot.online {
  background: #3DDC84;
  box-shadow: 0 0 6px #3DDC84;
}
.shahsara-online-dot.offline {
  background: #757575;
}
.shahsara-fr-details {
  text-align: right;
  min-width: 0;
}
.shahsara-fr-name {
  font-size: 13px;
  font-weight: 800;
  color: #FFF;
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shahsara-status-tag {
  display: inline-block;
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 8px;
  font-weight: 700;
}
.shahsara-status-tag.online {
  background: rgba(61, 220, 132, 0.18);
  color: #69F0AE;
  border: 1px solid rgba(61, 220, 132, 0.4);
}
.shahsara-status-tag.offline {
  background: rgba(158, 158, 158, 0.15);
  color: #BDBDBD;
  border: 1px solid rgba(158, 158, 158, 0.3);
}
.shahsara-fr-invite-btn {
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s;
  flex-shrink: 0;
}
.shahsara-fr-invite-btn.online {
  background: linear-gradient(135deg, #FFE082 0%, #D4AF37 100%);
  color: #150E00;
}
.shahsara-fr-invite-btn.offline {
  background: rgba(142, 68, 173, 0.25);
  color: #D7BDE2;
  border: 1px solid rgba(175, 122, 197, 0.4);
}
.shahsara-fr-invite-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}
.shahsara-fr-invite-btn.sent {
  background: rgba(61, 220, 132, 0.25) !important;
  color: #69F0AE !important;
  border: 1px solid #69F0AE !important;
}

/* 6. Vertical Right-Edge Tab Button for Room Invite (Room Lobby Only) */
#shahsara-room-invite-trigger {
  position: fixed;
  right: 0;
  top: 48%;
  transform: translateY(-50%);
  width: 34px;
  padding: 10px 0 12px 0;
  border-radius: 12px 0 0 12px;
  border: 1.5px solid rgba(212, 175, 55, 0.75);
  border-right: none;
  background: linear-gradient(180deg, rgba(14, 45, 26, 0.97) 0%, rgba(6, 20, 12, 0.98) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2147483647;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: -4px 4px 18px rgba(0, 0, 0, 0.7), 0 0 14px rgba(212, 175, 55, 0.35);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s, border-color 0.25s;
  user-select: none;
  animation: shahsaraEdgePulseGold 3s infinite ease-in-out;
}

@keyframes shahsaraEdgePulseGold {
  0%, 100% {
    box-shadow: -4px 4px 18px rgba(0, 0, 0, 0.7), 0 0 12px rgba(212, 175, 55, 0.3);
    border-color: rgba(212, 175, 55, 0.75);
  }
  50% {
    box-shadow: -6px 6px 24px rgba(0, 0, 0, 0.85), 0 0 20px rgba(255, 224, 130, 0.7);
    border-color: rgba(255, 224, 130, 0.95);
  }
}

#shahsara-room-invite-trigger:hover {
  transform: translateY(-50%) translateX(-4px);
  border-color: #FFF;
  box-shadow: -6px 6px 26px rgba(0, 0, 0, 0.85), 0 0 22px rgba(212, 175, 55, 0.7);
}

#shahsara-room-invite-trigger:active {
  transform: translateY(-50%) translateX(-2px) scale(0.96);
}

#shahsara-room-invite-trigger .shahsara-invite-fab-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#shahsara-room-invite-trigger .shahsara-add-user-icon {
  width: 19px;
  height: 19px;
  fill: #FFE082;
  transition: fill 0.2s ease, transform 0.2s ease;
  filter: drop-shadow(0 0 4px rgba(255, 224, 130, 0.45));
}

#shahsara-room-invite-trigger:hover .shahsara-add-user-icon {
  fill: #FFF;
  transform: scale(1.1);
}

#shahsara-room-invite-trigger .shahsara-invite-fab-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: -apple-system, BlinkMacSystemFont, "Vazirmatn", "Segoe UI", Roboto, sans-serif;
  font-size: 10px;
  font-weight: 900;
  color: #F5E6B8;
  letter-spacing: 1px;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  padding: 3px 0;
  transition: color 0.2s ease;
}

#shahsara-room-invite-trigger:hover .shahsara-invite-fab-text {
  color: #FFF;
}

#shahsara-room-invite-trigger.visible {
  display: flex !important;
}

/* 7. Toast Alerts */
#shahsara-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 2147483647;
  background: rgba(7, 24, 15, 0.95);
  border: 1px solid #D4AF37;
  color: #FFF;
  padding: 11px 22px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  direction: rtl;
  font-family: -apple-system, BlinkMacSystemFont, "Vazirmatn", "Segoe UI", Roboto, Tahoma, sans-serif;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75);
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#shahsara-toast.toast-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
