/* =============================================
   S4C – Space for Change | Project 3 Infographic
   ============================================= */

/* Main Container */
.p3-dashboard {
  background-color: #050505;
  color: #fff;
  padding: 60px 0;
  font-family: 'Outfit', sans-serif;
  background-image: radial-gradient(circle at top right, rgba(245, 200, 0, 0.05), transparent 40%),
                    radial-gradient(circle at bottom left, rgba(232, 64, 64, 0.05), transparent 40%);
}

.p3-header-top {
  text-align: center;
  margin-bottom: 50px;
}

.p3-header-top h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.1;
  text-transform: uppercase;
}

.p3-header-top h2 {
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: var(--yellow);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  margin-bottom: 20px;
}

.p3-header-top p {
  color: rgba(255, 255, 255, 0.7);
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.1rem;
}

/* Icons Header Row */
.p3-icons-row {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  margin: 30px 0;
}
.p3-icon-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
}
.p3-icon-item .icon {
  color: var(--yellow);
  font-size: 1.2rem;
}

/* Top Dual Column: 7 Pillars + 3 Categories Circle */
.p3-top-split {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.p3-left-pillars {
  flex: 1;
  min-width: 300px;
}

.p3-right-circle {
  flex: 1.5;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
}

/* 7 Pillars List */
.p3-section-title {
  font-size: 1.2rem;
  color: var(--yellow);
  text-transform: uppercase;
  margin-bottom: 20px;
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(245, 200, 0, 0.3);
  padding-bottom: 10px;
}

.p3-pillar {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}
.p3-pillar-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--yellow), #c29d00);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.p3-pillar-content h4 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 5px;
  text-transform: uppercase;
}
.p3-pillar-content p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Circular Cake Diagram (CD Style) */
.p3-cake-wrapper {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 auto;
}

/* Rotating Golden Ring with Planets */
.p3-golden-ring {
  position: absolute;
  width: calc(100% + 24px); /* 12px padding on each side for the gap + border */
  height: calc(100% + 24px);
  border: 1px solid var(--yellow);
  border-radius: 50%;
  animation: spinRing 10s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes spinRing {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 3 Planets on the ring */
.p3-planet {
  position: absolute;
  width: 10px; /* ~3mm relative to screen */
  height: 10px;
  background: radial-gradient(circle at 30% 30%, #fff, var(--yellow), #8b7300);
  border-radius: 50%;
  top: -5px; /* Half of height to center on the border */
  left: calc(50% - 5px);
  box-shadow: 0 0 10px var(--yellow);
}

.p3-planet:nth-child(2) {
  top: auto;
  bottom: 25%;
  left: -5px;
}

.p3-planet:nth-child(3) {
  top: auto;
  bottom: 25%;
  right: -5px;
  left: auto;
}

/* The CD Container */
.p3-cake-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 15px solid rgba(255, 255, 255, 0.15); /* Transparent white border ~5mm */
  background: #111;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(0,0,0,0.8); /* Drop shadow to separate from bg */
  z-index: 2;
  overflow: hidden;
  transform: rotate(-90deg); /* Start at top for the wedges */
}

.p3-cake-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.p3-cake-slice {
  stroke: #fff;
  stroke-width: 0.5;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  transform-origin: 50px 50px;
}

.p3-cake-slice:hover {
  stroke: var(--yellow);
  stroke-width: 2;
  transform: scale(1.05); /* Pop out effect */
  filter: brightness(1.2) drop-shadow(0 0 10px rgba(245,200,0,0.5));
}

/* Center Hole (CD Style) */
.p3-cake-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, #050505 40%, #1a1a1a 80%, #333 100%);
  border: 4px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 5px 15px rgba(0,0,0,0.9), 0 0 20px rgba(0,0,0,0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.p3-cake-center::after {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #000;
  box-shadow: inset 0 2px 5px rgba(255,255,255,0.2);
}

.p3-cake-center img {
  position: absolute;
  width: 40px;
  z-index: 6;
  pointer-events: none;
}

.p3-cake-content {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.p3-cake-label {
  position: absolute;
  width: auto;
  max-width: 150px;
  text-align: center;
  color: #ffffff !important;
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0,0,0,0.98), 0 1px 4px rgba(0,0,0,0.98);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible;
  overflow-wrap: break-word;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.45;
  text-transform: uppercase;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}

/*
  After rotate(-90deg) on the container, the visual wedge centres fall at:
  – Marketing (label-top-right in HTML):  ~32% from left, ~18% from top
  – Space Design (label-bottom in HTML):  ~76% from left, ~50% from top
  – Graphic Design (label-top-left HTML): ~32% from left, ~76% from top
*/

/* Marketing – upper-left wedge area after rotation */
.label-top-right {
  top: 10%;
  left: 30%;
  transform: translateX(-50%);
  max-width: 138px;
}

/* Space / Physical Branding – right wedge area after rotation */
.label-bottom {
  top: 44%;
  right: 3%;
  left: auto;
  transform: translateY(-50%);
  max-width: 130px;
  text-align: center;
}

/* Graphic Design – lower-left wedge area after rotation */
.label-top-left {
  bottom: 8%;
  left: 30%;
  transform: translateX(-50%);
  max-width: 138px;
}

.p3-cake-label .p3-lang-ar {
  font-family: sans-serif;
  font-weight: bold;
  font-size: 0.62rem;
  margin-top: 3px;
}

/* Responsive adjustment for circular diagram labels on mobile */
@media (max-width: 600px) {
  .p3-cake-label {
    max-width: 100px;
    font-size: 0.5rem;
    line-height: 1.3;
  }
  .label-top-right {
    top: 8%;
  }
  .label-bottom {
    right: 1%;
  }
  .label-top-left {
    bottom: 6%;
  }
}

/* Center Logo in Cake */
.p3-cake-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  background: #000;
  border: 2px solid var(--yellow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.p3-cake-center img {
  width: 60px;
}

/* Emotional Analysis Section */
.p3-emotional-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 40px;
  border-radius: 12px;
  margin-bottom: 60px;
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}
.p3-emotional-text {
  flex: 1;
  min-width: 300px;
}
.p3-emotional-text p {
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 15px;
}
.p3-results-grid {
  flex: 1;
  min-width: 300px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 20px;
}
.p3-result-item {
  text-align: center;
}
.p3-result-item .icon {
  font-size: 2rem;
  color: var(--yellow);
  margin-bottom: 10px;
}
.p3-result-item p {
  font-size: 0.8rem;
  color: #fff;
  text-transform: uppercase;
  font-weight: 600;
}

/* Client Journey Timeline */
.p3-journey-container {
  display: flex;
  gap: 20px;
  margin-bottom: 60px;
  overflow-x: auto;
  padding-bottom: 20px;
}
.p3-journey-step {
  flex: 1;
  min-width: 250px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--yellow);
  border-radius: 8px;
  padding: 20px;
  position: relative;
}
.p3-journey-step::after {
  content: '→';
  position: absolute;
  right: -15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--yellow);
  font-size: 1.5rem;
  z-index: 2;
}
.p3-journey-step:last-child::after {
  display: none;
}
.p3-journey-num {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 1px solid var(--yellow);
  border-radius: 50%;
  text-align: center;
  line-height: 28px;
  color: var(--black);
  background: var(--yellow);
  margin-bottom: 15px;
  font-weight: bold;
}
.p3-journey-step h4 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 15px;
  text-transform: uppercase;
}
.p3-journey-step ul {
  list-style: none;
  padding: 0;
}
.p3-journey-step ul li {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  margin-bottom: 8px;
  position: relative;
  padding-left: 15px;
}
.p3-journey-step ul li::before {
  content: '•';
  color: var(--yellow);
  position: absolute;
  left: 0;
}

/* Why Choose Us Grid */
.p3-why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}
.p3-why-item {
  text-align: center;
}
.p3-why-item .icon {
  font-size: 2.5rem;
  color: var(--yellow);
  margin-bottom: 15px;
}
.p3-why-item h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.p3-why-item p {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Showcase Grid */
.p3-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 60px;
}
.p3-showcase-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4/3;
}
.p3-showcase-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.p3-showcase-item:hover img {
  transform: scale(1.1);
}
.p3-showcase-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  padding: 20px 10px 10px;
  text-align: center;
  color: var(--yellow);
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9rem;
}

/* Custom Footer CTA */
.p3-footer-cta {
  display: flex;
  gap: 30px;
  align-items: center;
  background: rgba(255,255,255,0.05);
  padding: 40px;
  border-radius: 12px;
  flex-wrap: wrap;
}
.p3-footer-qr {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  background: #fff;
  padding: 5px;
  border-radius: 8px;
}
.p3-footer-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.p3-footer-text {
  flex: 1;
}
.p3-footer-text h3 {
  color: var(--yellow);
  font-size: 1.5rem;
  margin-bottom: 15px;
}
.p3-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}
.p3-footer-item h5 {
  color: #fff;
  font-size: 0.9rem;
  margin-bottom: 5px;
}
.p3-footer-item p {
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
}

/* Modals */
.p3-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.p3-modal.active {
  opacity: 1;
  visibility: visible;
}
.p3-modal-content {
  background: #111;
  border: 1px solid var(--yellow);
  padding: 40px;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  position: relative;
  text-align: center;
}
.p3-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}
.p3-modal-content h3 {
  color: var(--yellow);
  margin-bottom: 20px;
  font-size: 1.5rem;
}
.p3-modal-content p {
  color: rgba(255,255,255,0.8);
  line-height: 1.6;
}

/* =============================================
   Language Switcher & Bilingual Support (EN | AR)
   ============================================= */
.p3-lang-toggle-wrap {
  display: flex;
  justify-content: flex-end;
  max-width: 1200px;
  margin: 0 auto 30px;
  padding: 0 20px;
}
.p3-lang-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Outfit', sans-serif;
}
.p3-lang-btn:first-child {
  border-radius: 30px 0 0 30px;
  padding-left: 24px;
}
.p3-lang-btn:last-child {
  border-radius: 0 30px 30px 0;
  padding-right: 24px;
  border-left: none;
}
.p3-lang-btn.active {
  background: var(--yellow);
  color: #000;
  border-color: var(--yellow);
}
.p3-lang-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Language display rules */
.p3-lang-ar {
  display: none !important;
}
.p3-dashboard.lang-ar-active .p3-lang-en {
  display: none !important;
}
.p3-dashboard.lang-ar-active .p3-lang-ar {
  display: block !important;
}
/* Specific display modes */
.p3-dashboard.lang-ar-active span.p3-lang-ar {
  display: inline !important;
}
.p3-dashboard.lang-ar-active div.p3-lang-ar {
  display: block !important;
}
.p3-dashboard.lang-ar-active .p3-pillar.p3-lang-ar {
  display: flex !important;
}
.p3-dashboard.lang-ar-active .p3-why-item.p3-lang-ar {
  display: block !important;
}
.p3-dashboard.lang-ar-active .p3-result-item.p3-lang-ar {
  display: block !important;
}
.p3-dashboard.lang-ar-active .p3-journey-step.p3-lang-ar {
  display: block !important;
}
.p3-dashboard.lang-ar-active .p3-showcase-caption span.p3-lang-ar {
  display: inline-block !important;
}

/* RTL Layout Flip */
.p3-dashboard.lang-ar-active {
  direction: rtl;
  text-align: right;
}
.p3-dashboard.lang-ar-active .p3-section-title {
  text-align: right;
  border-bottom: 1px solid rgba(245, 200, 0, 0.3);
  padding-bottom: 10px;
}
.p3-dashboard.lang-ar-active .p3-pillar {
  flex-direction: row;
}
.p3-dashboard.lang-ar-active .p3-pillar-num {
  margin-right: 0;
  margin-left: 15px;
}
.p3-dashboard.lang-ar-active .p3-journey-step {
  text-align: right;
}
.p3-dashboard.lang-ar-active .p3-journey-step ul li {
  padding-left: 0;
  padding-right: 15px;
}
.p3-dashboard.lang-ar-active .p3-journey-step ul li::before {
  left: auto;
  right: 0;
}
.p3-dashboard.lang-ar-active .p3-journey-step::after {
  content: '←';
  right: auto;
  left: -15px;
}
.p3-dashboard.lang-ar-active .p3-journey-step:last-child::after {
  display: none;
}
.p3-dashboard.lang-ar-active .p3-cake-label {
  text-align: right;
}
.p3-dashboard.lang-ar-active .p3-cake-label h4 {
  font-family: sans-serif;
}
.p3-dashboard.lang-ar-active .p3-cake-label p {
  font-family: sans-serif;
}
.p3-dashboard.lang-ar-active .p3-footer-text {
  text-align: right;
}
.p3-dashboard.lang-ar-active .p3-footer-item {
  text-align: right;
}

/* Responsive adjustment for mobile screen sizes (ensuring circle shape remains circular and doesn't distort) */
@media (max-width: 768px) {
  .p3-right-circle {
    min-width: 100% !important;
    width: 100% !important;
    padding: 0;
  }
  .p3-cake-wrapper {
    max-width: 290px !important;
    width: 90% !important;
  }
  .p3-cake-container {
    border-width: 8px !important;
  }
  .p3-cake-center {
    width: 70px !important;
    height: 70px !important;
  }
  .p3-cake-center img {
    width: 42px !important;
  }
  .p3-golden-ring {
    width: calc(100% + 16px) !important;
    height: calc(100% + 16px) !important;
  }
  .p3-planet {
    width: 8px !important;
    height: 8px !important;
    top: -4px !important;
    left: calc(50% - 4px) !important;
  }
}

