@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   TPMA Website - Custom Stylesheet
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Figtree, system-ui, sans-serif;
  color: #0A2A55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, .fd {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  letter-spacing: -.025em;
}

/* Nav Link Hover Underline Animation */
.lnk {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size .25s;
}

.lnk:hover {
  background-size: 100% 2px;
}

/* Dropdown Menu Transitions */
.dd {
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: .2s ease;
}

.dd-wrap:hover .dd,
.dd-wrap.open .dd,
.dd-wrap:focus-within .dd {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Buttons */
.btn {
  display: inline-block;
  border-radius: 9999px;
  padding: 0.9rem 1.8rem;
  font-weight: 700;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -14px rgba(10, 42, 85, 0.5);
}

.b1 {
  background: #1668C9;
  color: #fff;
}

.b2 {
  border: 2px solid #0A2A55;
  color: #0A2A55;
}

.b2:hover {
  background: #0A2A55;
  color: #fff;
}

.b3 {
  background: #fff;
  color: #0A2A55;
}

.b3:hover {
  background: #f4f9fd;
}

.b4 {
  border: 2px solid #fff;
  color: #fff;
}

.b4:hover {
  background: #fff;
  color: #0A2A55;
}

:focus-visible {
  outline: 3px solid #1668C9;
  outline-offset: 3px;
  border-radius: 6px;
}

/* Typewriter Screen for Under Creation Pages */
.typewriter-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 12rem 1.5rem 6rem;
}

.typewriter {
  font-size: clamp(1.35rem, 3.5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #0A2A55;
}

.cursor {
  display: inline-block;
  margin-left: 3px;
  font-weight: 300;
  color: #0E7FA8;
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Video Player Section */
.poster {
  background: repeating-linear-gradient(135deg, #1B4580 0 14px, #153761 14px 28px);
}

.lbl {
  background: rgba(255, 255, 255, 0.16);
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  backdrop-filter: blur(4px);
}

.play {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: #ffffff;
  color: #1668C9;
  box-shadow: 0 10px 25px -5px rgba(10, 42, 85, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.8);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s, color 0.25s;
}

.pbtn:hover .play {
  transform: scale(1.12);
  background: #1668C9;
  color: #ffffff;
  box-shadow: 0 20px 40px -10px rgba(22, 104, 201, 0.5), 0 0 0 10px rgba(255, 255, 255, 0.25);
}

/* Aspect ratio utility for portrait presentation video (9:16) */
.aspect-portrait {
  aspect-ratio: 9 / 16;
}

/* ==========================================================================
   iPhone Realistic Mockup with Dynamic Island
   ========================================================================== */
/* ==========================================================================
   iPhone Realistic Mockup with Dynamic Island (Tall Modern 19.5:9 Aspect Ratio)
   ========================================================================== */
.iphone-frame {
  position: relative;
  background: linear-gradient(145deg, #1e293b, #0f172a 40%, #020617);
  border-radius: 56px;
  padding: 10px;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 30px 70px -15px rgba(10, 42, 85, 0.5),
    0 15px 35px -10px rgba(0, 0, 0, 0.6),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.35);
}

/* iPhone Hardware Buttons: Left (Action, Vol Up, Vol Down) */
.iphone-frame::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 110px;
  width: 3px;
  height: 24px;
  background: #334155;
  border-radius: 2px 0 0 2px;
  box-shadow: 0 44px 0 #334155, 0 100px 0 #334155;
}

/* iPhone Hardware Button: Right (Power / Siri) */
.iphone-frame::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 155px;
  width: 3px;
  height: 64px;
  background: #334155;
  border-radius: 0 2px 2px 0;
}

/* iPhone Screen Bezel (Tall 19.5:9 Aspect Ratio) */
.iphone-screen {
  position: relative;
  border-radius: 46px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 9 / 19.5;
  box-shadow: inset 0 0 0 2px #000;
}

/* Dynamic Island Pill */
.dynamic-island {
  position: absolute;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  width: 116px;
  height: 30px;
  background: #000000;
  border-radius: 9999px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.dynamic-island-camera {
  width: 12px;
  height: 12px;
  background: #0b111c;
  border-radius: 50%;
  box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dynamic-island-lens {
  width: 5.5px;
  height: 5.5px;
  background: radial-gradient(circle, #1668C9 15%, #071930 85%);
  border-radius: 50%;
}

.dynamic-island-sensor {
  width: 6.5px;
  height: 6.5px;
  background: #10b981;
  border-radius: 50%;
  opacity: 0.85;
  box-shadow: 0 0 6px #10b981;
}

/* iPhone Home Bar */
.iphone-home-bar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 132px;
  height: 4.5px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 9999px;
  z-index: 30;
  pointer-events: none;
}

/* ==========================================================================
   Protected Catalogue PDF Scroll Viewer
   ========================================================================== */
.pdf-viewer-wrap {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.pdf-scroll-track {
  scrollbar-width: thin;
  scrollbar-color: #0E7FA8 #E1F1FA;
}

.pdf-scroll-track::-webkit-scrollbar {
  width: 8px;
}

.pdf-scroll-track::-webkit-scrollbar-track {
  background: #E1F1FA;
  border-radius: 8px;
}

.pdf-scroll-track::-webkit-scrollbar-thumb {
  background: #0E7FA8;
  border-radius: 8px;
}

.pdf-scroll-track::-webkit-scrollbar-thumb:hover {
  background: #1668C9;
}

.pdf-page-sheet {
  box-shadow: 0 10px 25px -5px rgba(10, 42, 85, 0.12), 0 0 0 1px #CFDDEC;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.pdf-watermark-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 140px,
    rgba(10, 42, 85, 0.015) 140px,
    rgba(10, 42, 85, 0.015) 280px
  );
}

/* Services Tabbed Panel */
.tab {
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab[aria-selected="true"] {
  background: #0A2A55;
  color: #fff;
  border-color: #0A2A55;
}

.tab[aria-selected="false"]:hover {
  background: #F4F9FD;
  border-color: #0E7FA8;
}

/* Placeholder card (.ph) */
.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  border-radius: 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0A2A55;
  background: repeating-linear-gradient(135deg, #E1F1FA 0 12px, #CDE6F5 12px 24px);
  border: 1px dashed #0E7FA8;
}

.ph span {
  background: #fff;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  max-width: 100%;
  box-shadow: 0 2px 6px rgba(10, 42, 85, 0.08);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.96) translateY(18px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-scale.in {
  opacity: 1;
  transform: none;
}

.delay-75 { transition-delay: 75ms; }
.delay-100 { transition-delay: 100ms; }
.delay-150 { transition-delay: 150ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Training List Row Hover Effect */
.row {
  transition: background 0.2s ease, padding 0.2s ease;
}

@media (hover: hover) {
  .row:hover {
    background: #E1F1FA;
    padding-left: 1.5rem;
    padding-right: 1rem;
    border-radius: 0.75rem;
  }
}

/* ==========================================================================
   Language Switcher & RTL (Arabic) Support
   ========================================================================== */
.lang-btn {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  border: none;
  background: transparent;
  line-height: 1.2;
}

.lang-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.lang-btn.active {
  background: #1668C9;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(10, 42, 85, 0.3);
}

/* Mobile Drawer Language Button variant */
.lang-btn-mobile {
  color: #0A2A55;
  background: #E1F1FA;
}

.lang-btn-mobile:hover {
  background: #CFDDEC;
  color: #0A2A55;
}

.lang-btn-mobile.active {
  background: #0A2A55;
  color: #ffffff;
}

/* RTL Typography & Direction Rules */
[dir="rtl"] {
  font-family: 'Cairo', system-ui, sans-serif;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] .fd,
[dir="rtl"] .typewriter {
  font-family: 'Cairo', system-ui, sans-serif;
  letter-spacing: normal;
}

[dir="rtl"] .cursor {
  margin-left: 0;
  margin-right: 0.2rem;
}

/* Mirror border and padding utilities for RTL */
[dir="rtl"] .border-l-4 {
  border-left-width: 0 !important;
  border-right-width: 4px !important;
}

[dir="rtl"] .border-l-2 {
  border-left-width: 0 !important;
  border-right-width: 2px !important;
}

[dir="rtl"] .border-l {
  border-left-width: 0 !important;
  border-right-width: 1px !important;
}

[dir="rtl"] .pl-3 {
  padding-left: 0 !important;
  padding-right: 0.75rem !important;
}

[dir="rtl"] .pl-4 {
  padding-left: 0 !important;
  padding-right: 1rem !important;
}

[dir="rtl"] .pl-6,
[dir="rtl"] .sm\:pl-6 {
  padding-left: 0 !important;
  padding-right: 1.5rem !important;
}

[dir="rtl"] .ml-3 {
  margin-left: 0 !important;
  margin-right: 0.75rem !important;
}

[dir="rtl"] .sm\:text-right {
  text-align: right !important;
}

@media (min-width: 640px) {
  [dir="rtl"] .sm\:text-right {
    text-align: left !important;
  }
}

/* Number and Phone Direction Isolation (prevents inverted numbers in Arabic) */
[dir="rtl"] [data-counter],
[dir="rtl"] .num-ltr,
[dir="rtl"] a[href^="tel:"],
[dir="rtl"] .phone-ltr,
[dir="rtl"] [dir="ltr"] {
  direction: ltr !important;
  unicode-bidi: isolate !important;
  display: inline-block;
  text-align: left;
}

[dir="rtl"] a[href^="tel:"] {
  white-space: nowrap;
}