/* ==========================================================================
   Radial Arc Roller Menu (Pure Half-Circle Dial / رول نصف دائري دوار)
   Clean, purely circular geometry with NO awkward rectangular boxes!
   ========================================================================== */

/* 1. Fullscreen Blur Backdrop Overlay */
.radial-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 6, 16, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 99990;
  pointer-events: none;
}

.radial-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 3. The Pure Semi-Circle Rotary Dial Stage ("نصف دائرة هندسية نقية") */
.radial-dial-stage {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 290px;
  height: 500px;
  z-index: 99995;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  background: linear-gradient(135deg, rgba(8, 14, 32, 0.96) 0%, rgba(3, 7, 18, 0.98) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: hidden; /* Clips everything inside the pure semi-circle! */
  transition: right 0.45s cubic-bezier(0.16, 1, 0.3, 1), left 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  box-sizing: border-box;
}

/* RTL: Appears from RIGHT edge curving into screen */
body.dir-rtl .radial-dial-stage {
  right: -330px;
  border-radius: 250px 0 0 250px;
  border-left: 2px solid rgba(0, 229, 255, 0.65);
  border-top: 1.5px solid rgba(0, 229, 255, 0.35);
  border-bottom: 1.5px solid rgba(0, 229, 255, 0.35);
  border-right: none;
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.95), -5px 0 30px rgba(0, 229, 255, 0.4), inset 15px 0 30px rgba(0, 112, 243, 0.25);
  opacity: 0;
  pointer-events: none;
}

body.dir-rtl .radial-dial-stage.active {
  right: 0;
  opacity: 1;
  pointer-events: auto;
}

/* LTR: Appears from LEFT edge curving into screen */
body.dir-ltr .radial-dial-stage {
  left: -330px;
  border-radius: 0 250px 250px 0;
  border-right: 2px solid rgba(0, 229, 255, 0.65);
  border-top: 1.5px solid rgba(0, 229, 255, 0.35);
  border-bottom: 1.5px solid rgba(0, 229, 255, 0.35);
  border-left: none;
  box-shadow: 20px 0 50px rgba(0, 0, 0, 0.95), 5px 0 30px rgba(0, 229, 255, 0.4), inset -15px 0 30px rgba(0, 112, 243, 0.25);
  opacity: 0;
  pointer-events: none;
}

body.dir-ltr .radial-dial-stage.active {
  left: 0;
  opacity: 1;
  pointer-events: auto;
}

/* The Full-Bleed Curved Arena */
.radial-arc-arena {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Center Hub Live Console on the Screen Edge ("المحور التفاعلي الأنيق") */
.radial-dial-core {
  position: absolute;
  top: 50%;
  width: 105px;
  height: 160px;
  transform: translateY(-50%);
  background: radial-gradient(circle at 100% 50%, #17284f 0%, #060a14 100%);
  border: 2px solid rgba(0, 229, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(0, 112, 243, 0.5), inset 5px 0 15px rgba(0, 229, 255, 0.25);
  z-index: 10;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

body.dir-rtl .radial-dial-core {
  right: 0;
  border-radius: 80px 0 0 80px;
  border-right: none;
  padding-left: 8px;
}

body.dir-ltr .radial-dial-core {
  left: 0;
  border-radius: 0 80px 80px 0;
  border-left: none;
  padding-right: 8px;
}

.radial-dial-core:hover {
  box-shadow: 0 0 35px rgba(0, 229, 255, 0.7), inset 8px 0 20px rgba(0, 229, 255, 0.35);
}

.radial-core-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  max-width: 85px;
}

.radial-core-icon {
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.7));
  transition: transform 0.2s;
}

.radial-core-title {
  font-size: 0.74rem;
  font-weight: 900;
  color: #00e5ff;
  letter-spacing: 0.3px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 78px;
}

.radial-core-sub {
  font-size: 0.62rem;
  color: #f1f5f9;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 78px;
}

.radial-core-hint {
  font-size: 0.55rem;
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Glowing Focus Needle Pointer */
.radial-active-pointer {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  z-index: 15;
  pointer-events: none;
}

body.dir-rtl .radial-active-pointer {
  right: 172px;
}

body.dir-ltr .radial-active-pointer {
  left: 172px;
}

.pointer-head {
  font-size: 1.3rem;
  color: #00e5ff;
  animation: pulsePointer 1.4s infinite alternate;
}

@keyframes pulsePointer {
  from { transform: scale(0.9); opacity: 0.7; }
  to { transform: scale(1.25); opacity: 1; text-shadow: 0 0 15px #00e5ff; }
}

/* The Rotary Orbit Wheel (Zero-size origin at hub center) */
.radial-rotary-wheel {
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  overflow: visible;
  transition: transform 0.15s cubic-bezier(0.1, 0.7, 0.1, 1);
  will-change: transform;
}

body.dir-rtl .radial-rotary-wheel {
  right: 0;
}

body.dir-ltr .radial-rotary-wheel {
  left: 0;
}

/* Circular Buttons along the Arc ("أزرار دائرية هندسية نقية") */
.radial-node-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 68px;
  height: 68px;
  margin-top: -34px;
  margin-left: -34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #182848 0%, #09101d 100%);
  border: 1.8px solid rgba(0, 229, 255, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), 0 0 15px rgba(0, 112, 243, 0.25);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: #fff;
  text-align: center;
  padding: 4px;
  box-sizing: border-box;
}

.radial-node-item:hover,
.radial-node-item.is-selected {
  background: linear-gradient(135deg, rgba(0, 112, 243, 0.95), rgba(0, 229, 255, 0.85)) !important;
  border-color: #00e5ff !important;
  color: #070c18 !important;
  box-shadow: 0 10px 30px rgba(0, 112, 243, 0.6), 0 0 25px rgba(0, 229, 255, 0.7) !important;
  z-index: 25;
}

.radial-node-emoji {
  font-size: 1.35rem;
  line-height: 1;
  margin-bottom: 2px;
  pointer-events: none;
}

.radial-node-title {
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.1;
  color: inherit;
  max-width: 60px;
  text-align: center;
  word-break: break-word;
  pointer-events: none;
}

.radial-node-item.is-selected .radial-node-title {
  color: #070c18 !important;
  font-weight: 900;
}

/* WhatsApp & Call specific styles */
.radial-node-item.wa-node {
  border-color: rgba(37, 211, 102, 0.5);
}
.radial-node-item.wa-node.is-selected {
  background: linear-gradient(135deg, #25d366, #128c7e) !important;
  color: #fff !important;
  box-shadow: 0 0 25px rgba(37, 211, 102, 0.8) !important;
}

.radial-node-item.call-node {
  border-color: rgba(0, 112, 243, 0.6);
}

/* Responsive Dimensions for Mobile Screens */
@media (max-width: 480px) {
  .radial-dial-stage {
    width: 240px;
    height: 420px;
  }
  body.dir-rtl .radial-dial-stage {
    right: -260px;
    border-radius: 210px 0 0 210px;
  }
  body.dir-ltr .radial-dial-stage {
    left: -260px;
    border-radius: 0 210px 210px 0;
  }
  .radial-dial-core {
    width: 90px;
    height: 140px;
  }
  body.dir-rtl .radial-dial-core {
    border-radius: 70px 0 0 70px;
  }
  body.dir-ltr .radial-dial-core {
    border-radius: 0 70px 70px 0;
  }
  .radial-core-title {
    font-size: 0.68rem;
    max-width: 70px;
  }
  .radial-core-sub {
    font-size: 0.58rem;
    max-width: 70px;
  }
  body.dir-rtl .radial-active-pointer {
    right: 148px;
  }
  body.dir-ltr .radial-active-pointer {
    left: 148px;
  }
  .radial-node-item {
    width: 60px;
    height: 60px;
    margin-top: -30px;
    margin-left: -30px;
  }
  .radial-node-emoji {
    font-size: 1.2rem;
  }
  .radial-node-title {
    font-size: 0.58rem;
    max-width: 52px;
  }
}
