/* ============================================
   Alex Portfolio - Main Stylesheet
   Primary: #00f2ea (Teal) / #ADD8E6 (Light Blue)
   ============================================ */

/* Base & RTL */
body {
  font-family: 'Almarai', 'IBM Plex Sans Arabic', sans-serif;
}

[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .section-label {
  border-right: 4px solid;
  padding-right: 1rem;
  margin-right: 0;
  border-left: none;
  padding-left: 0;
}

/* Section Styling - Unified */
.section-label {
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: color 0.2s, gap 0.2s;
}

.section-link:hover {
  gap: 0.75rem;
}

/* Card Hover - Distinctive */
.card-hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.12);
}

/* Masonry Grid */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-rows: 10px;
}

.masonry-item {
  grid-row-end: span 20;
}

.masonry-item.tall {
  grid-row-end: span 35;
}

.masonry-item.medium {
  grid-row-end: span 25;
}

/* RTL Icon Flip */
.rtl-flip {
  transform: scaleX(-1);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #00f2ea 0%, #00c2ba 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Prose (Blog) */
.prose-custom p {
  font-size: 1.125rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  color: rgb(51 65 85);
}

.dark .prose-custom p {
  color: rgb(203 213 225);
}

.prose-custom h2 {
  font-size: 1.875rem;
  font-weight: 900;
  margin-top: 4rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.025em;
}

/* Case Study */
.case-study-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
}

.text-vertical {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* Dropdown Menu - Smart Appearance */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 99;
  backdrop-filter: blur(2px);
}

.nav-dropdown.open .nav-dropdown-backdrop {
  opacity: 1;
  visibility: visible;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  min-width: 240px;
  background: white;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.03);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95) translateY(-8px);
  transform-origin: top right;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.2s;
  z-index: 100;
  overflow: hidden;
}

/* Nav on LEFT (e.g. about page) - menu opens to the RIGHT */
.nav-left .nav-dropdown-menu {
  right: auto;
  left: 0;
  transform-origin: top left;
}

.dark .nav-dropdown-menu {
  background: rgb(15 23 42);
  border-color: rgb(51 65 85);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

/* Staggered item animation - cascade effect */
.nav-dropdown-menu a {
  display: block;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: rgb(51 65 85);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s, color 0.15s;
}

.nav-dropdown.open .nav-dropdown-menu a {
  opacity: 1;
  transform: translateY(0);
}

.nav-dropdown.open .nav-dropdown-menu a:nth-child(1) { transition-delay: 0.02s; }
.nav-dropdown.open .nav-dropdown-menu a:nth-child(2) { transition-delay: 0.04s; }
.nav-dropdown.open .nav-dropdown-menu a:nth-child(3) { transition-delay: 0.06s; }
.nav-dropdown.open .nav-dropdown-menu a:nth-child(4) { transition-delay: 0.08s; }
.nav-dropdown.open .nav-dropdown-menu a:nth-child(5) { transition-delay: 0.1s; }
.nav-dropdown.open .nav-dropdown-menu a:nth-child(6) { transition-delay: 0.12s; }

.nav-dropdown-menu a:hover {
  background: rgba(0, 242, 234, 0.08);
  color: #00f2ea;
}

.dark .nav-dropdown-menu a {
  color: rgb(226 232 240);
}

.dark .nav-dropdown-menu a:hover {
  background: rgba(0, 242, 234, 0.12);
}

/* Sub-items in dropdown */
.nav-dropdown-sub {
  padding-right: 1.5rem !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
}

/* Mobile Menu */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-menu.open {
  max-height: 500px;
}

/* Accordion (FAQ) */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.accordion-item.open .accordion-content {
  max-height: 500px;
}

.accordion-item.open .accordion-toggle {
  transform: rotate(180deg);
  color: #00f2ea;
}

/* Smooth scroll for anchor links */
html {
  scroll-behavior: smooth;
}
