/* agileoffice Custom CSS & Zero-Shadow Flat Design System */

/* Universal Zero-Shadow Reset */
*,
*::before,
*::after {
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
}

/* Typography & Color Foundations */
:root {
  --header-height: 5rem; /* 80px */
  --font-latin: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-arabic: 'Cairo', 'Inter', system-ui, -apple-system, sans-serif;

  /* Primary Brand Colors */
  --color-primary: #4A90E2;
  --color-primary-dark: #357ABD;
  --color-primary-accessible: #2A639B;
  --color-brand-dark: #0F172A;
  --color-surface: #F8FAFC;
  --color-surface-warm: #F0F7FF;
}

body {
  font-family: var(--font-latin);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* RTL & Arabic Typography Rules */
html[dir="rtl"] body,
html[lang="ar"] body {
  font-family: var(--font-arabic);
  line-height: 1.65;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
  font-family: var(--font-arabic);
  letter-spacing: normal !important;
}

/* RTL Directional Mirroring */
html[dir="rtl"] .rtl-mirror {
  transform: scaleX(-1);
  display: inline-block;
}

/* RTL Dropdown Alignment */
html[dir="rtl"] .lang-dropdown-menu {
  right: auto !important;
  left: 0 !important;
}

/* Language Selector Badges - Prevent wrapping across hyphens */
.lang-dropdown-menu {
  min-width: 15rem !important;
}

#current-lang-code,
.lang-option span:last-child {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* Typography Weight Cap: Last weight is semibold (600), no bold or extrabold */
b, strong, th, h1, h2, h3, h4, h5, h6,
.font-bold, .font-extrabold, .font-black {
  font-weight: 600 !important;
}

/* Viewport Height Utilities */
.hero-vh {
  height: calc(100vh - var(--header-height));
  height: calc(100svh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
}

.full-dvh {
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

.hero-100dvh {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

@media (min-width: 1024px) {
  .hero-100dvh {
    height: 100vh;
    height: 100svh;
    height: 100dvh;
  }
}

/* ==========================================================================
   Smart Header & Dynamic Hero Theme
   ========================================================================== */
#site-header {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease, border-color 0.25s ease;
  will-change: transform, background-color, border-color;
}

#site-header.header-hidden {
  transform: translateY(-100%);
}

#site-header.header-visible {
  transform: translateY(0);
}

/* Transparent Header in Hero Section (Light Hero Palette) */
#site-header.header-transparent {
  background-color: transparent;
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background-color 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease, -webkit-backdrop-filter 0.25s ease;
}

/* On Scroll within Hero Section: Frosted Glass */
#site-header.header-transparent.header-scrolled {
  background-color: rgba(255, 255, 255, 0.88) !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

#site-header.header-transparent .header-logo-dark {
  display: none !important;
}
#site-header.header-transparent .header-logo-light {
  display: block !important;
}

#site-header.header-transparent .header-divider-dark {
  display: none !important;
}
#site-header.header-transparent .header-divider-light {
  display: block !important;
}

#site-header.header-transparent .header-tagline {
  color: #64748B !important;
  border-color: #CBD5E1 !important;
}

#site-header.header-transparent .header-nav-link {
  color: #334155 !important;
}
#site-header.header-transparent .header-nav-link:hover {
  color: #0F172A !important;
}

#site-header.header-transparent #lang-toggle-btn {
  color: #334155 !important;
  background-color: rgba(255, 255, 255, 0.8) !important;
  border: 1px solid #CBD5E1 !important;
}
#site-header.header-transparent #lang-toggle-btn:hover {
  background-color: #FFFFFF !important;
}
#site-header.header-transparent #lang-toggle-btn i {
  color: #475569 !important;
}

#site-header.header-transparent .header-cta {
  color: #FFFFFF !important;
  background-color: #4A90E2 !important;
  border: 1px solid #4A90E2 !important;
  font-weight: 600 !important;
}
#site-header.header-transparent .header-cta:hover {
  background-color: #357ABD !important;
}

#site-header.header-transparent #mobile-menu-btn {
  color: #0F172A !important;
}

/* Solid Header (Past Hero Section) */
#site-header.header-solid {
  background-color: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 1px solid #E2E8F0 !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

#site-header.header-solid .header-logo-dark {
  display: none !important;
}
#site-header.header-solid .header-logo-light {
  display: block !important;
}

#site-header.header-solid .header-divider-dark {
  display: none !important;
}
#site-header.header-solid .header-divider-light {
  display: block !important;
}

#site-header.header-solid .header-tagline {
  color: #64748B !important;
  border-color: #CBD5E1 !important;
}

#site-header.header-solid .header-nav-link {
  color: #475569 !important;
}
#site-header.header-solid .header-nav-link:hover {
  color: #0F172A !important;
}

#site-header.header-solid #lang-toggle-btn {
  color: #334155 !important;
  background-color: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
}
#site-header.header-solid #lang-toggle-btn:hover {
  background-color: #E2E8F0 !important;
}
#site-header.header-solid #lang-toggle-btn i {
  color: #475569 !important;
}

#site-header.header-solid .header-cta {
  color: #FFFFFF !important;
  background-color: #4A90E2 !important;
  border: 1px solid #4A90E2 !important;
  font-weight: 600 !important;
}
#site-header.header-solid .header-cta:hover {
  background-color: #357ABD !important;
}

#site-header.header-solid #mobile-menu-btn {
  color: #475569 !important;
}

/* Header Menu Dividers */
.header-divider-img {
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

#site-header.header-solid .header-divider-img {
  opacity: 0.5;
}

[dir="rtl"] .header-divider-left .header-divider-img,
[dir="rtl"] .header-divider-right .header-divider-img {
  transform: scaleX(-1);
}

/* ==========================================================================
   SVG Flag Icons Styling
   ========================================================================== */
.flag-icon {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  display: inline-block;
}

/* ==========================================================================
   Sticky GDPR Badge
   ========================================================================== */
.sticky-gdpr {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 20;
  transition: all 0.3s ease;
}

@media (min-width: 640px) {
  .sticky-gdpr {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

/* Maintain identical bottom-right positioning for GDPR badge in RTL */
[dir="rtl"] .sticky-gdpr {
  right: 1rem !important;
  left: auto !important;
}

@media (min-width: 640px) {
  [dir="rtl"] .sticky-gdpr {
    right: 1.5rem !important;
    left: auto !important;
  }
}

/* ==========================================================================
   Telephone & Number BiDi Formatting
   ========================================================================== */
/* Telephone numbers and contact links are strictly read Left-To-Right (LTR) even in RTL */
a[href^="tel:"],
.phone-link,
[data-i18n*="phone_"] {
  direction: ltr !important;
  unicode-bidi: isolate !important;
  display: inline-block;
  text-align: left;
}

/* Smooth Transitions without Shadow */
a, button, input, select, textarea {
  transition-property: color, background-color, border-color, opacity;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0F172A;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4A90E2;
}

/* ==========================================================================
   Section Chips & Contact Form Utilities
   ========================================================================== */
.section-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: rgba(74, 144, 226, 0.1);
  border: 1px solid rgba(74, 144, 226, 0.3);
  color: #2A639B;
}

.section-chip-dark {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: rgba(74, 144, 226, 0.15);
  border: 1px solid rgba(74, 144, 226, 0.35);
  color: #7DB6F8;
}

/* Custom Contact Form Checkbox */
.contact-checkbox {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 1rem;
  height: 1rem;
  border: 1px solid #B9D8FB;
  border-radius: 4px;
  background-color: #ffffff;
}

.contact-checkbox:focus {
  outline: none;
  border-color: #4A90E2;
}

.contact-checkbox:checked {
  background-color: #0F172A;
  border-color: #0F172A;
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='square' stroke-linejoin='miter' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3.5 8.5l3 3 6-6'/%3e%3c/svg%3e");
  background-size: 85% 85%;
  background-position: center;
  background-repeat: no-repeat;
}

/* ==========================================================================
   Hero Section Styling
   ========================================================================== */
.hero-gradient-bg {
  background: 
    radial-gradient(circle at 12% 18%, rgba(215, 230, 255, 0.75) 0%, rgba(215, 230, 255, 0) 55%),
    radial-gradient(circle at 88% 78%, rgba(254, 235, 245, 0.7) 0%, rgba(254, 235, 245, 0) 55%),
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.95) 0%, rgba(246, 250, 255, 0.8) 100%),
    linear-gradient(135deg, #EBF2FE 0%, #FFFFFF 45%, #FAF4F8 100%);
}

.hero-start-btn {
  background-color: #0B2545;
  color: #FFFFFF;
  border: 1px solid #4A90E2;
  box-shadow: none !important;
  transition: all 0.2s ease-in-out;
}

.hero-start-btn:hover {
  background-color: #071B33;
  border-color: #60A5FA;
  box-shadow: none !important;
}

/* ==========================================================================
   Features Section - Atmospheric Ambient Glows & 3D Carousel
   ========================================================================== */
.features-ambient-glow-top {
  position: absolute;
  top: -12rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1400px;
  max-width: 100vw;
  height: 800px;
  background: radial-gradient(ellipse at 50% 15%, rgba(59, 130, 246, 0.16) 0%, rgba(59, 130, 246, 0.08) 35%, rgba(79, 70, 229, 0.03) 55%, transparent 70%);
  filter: blur(160px);
  -webkit-filter: blur(160px);
  border-radius: 9999px;
  pointer-events: none;
  opacity: 0.9;
}

.features-ambient-glow-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1300px;
  max-width: 100vw;
  height: 750px;
  background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.10) 0%, rgba(37, 99, 235, 0.03) 40%, transparent 65%);
  filter: blur(140px);
  -webkit-filter: blur(140px);
  border-radius: 9999px;
  pointer-events: none;
}

.features-3d-wrapper {
  position: relative;
  width: 100%;
}

.features-3d-stage {
  position: relative;
  width: 100%;
  perspective: 1200px;
  perspective-origin: 50% 50%;
  overflow: visible !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 560px;
  padding: 1.5rem 0 2rem;
  touch-action: pan-y;
  user-select: none;
}

@media (min-width: 1024px) {
  .features-3d-stage {
    min-height: 480px;
  }
}

.features-3d-carousel {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 100%;
  min-height: 480px;
  transform-style: preserve-3d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.features-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 92%;
  max-width: 880px;
  border-radius: 2rem;
  padding: 2.25rem 2rem;
  color: #0f172a;
  /* Luminous multi-layered gradient surface with depth */
  background: linear-gradient(145deg, #FFFFFF 0%, #EEF4FE 25%, #DBE7FD 70%, #CFDFFD 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.95) inset,
    0 2px 4px rgba(255, 255, 255, 0.95) inset,
    0 -2px 6px rgba(37, 99, 235, 0.08) inset,
    0 25px 60px -12px rgba(2, 8, 23, 0.65),
    0 12px 28px -6px rgba(30, 64, 175, 0.25) !important;
  transform-origin: center center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity, filter, box-shadow, border-color;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  margin: 0;
}

@media (max-width: 640px) {
  .features-card {
    width: 94%;
    padding: 1.5rem 1.25rem;
    border-radius: 1.5rem;
  }
}

/* Card Depth Dimming Overlays (Stretches beyond 1px border so border is fully dimmed) */
.features-card-overlay {
  position: absolute;
  top: -1.5px;
  left: -1.5px;
  right: -1.5px;
  bottom: -1.5px;
  border-radius: 2rem;
  pointer-events: none;
  background-color: transparent;
  transition: background-color 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 20;
}

@media (max-width: 640px) {
  .features-card-overlay {
    border-radius: 1.5rem;
  }
}

.features-card.is-active .features-card-overlay {
  background-color: rgba(0, 0, 0, 0) !important;
}

.features-card.is-layer-1 .features-card-overlay {
  background-color: rgba(0, 0, 0, 0.38) !important;
}

.features-card.is-layer-1:hover .features-card-overlay {
  background-color: rgba(0, 0, 0, 0.22) !important;
}

.features-card.is-layer-2 .features-card-overlay {
  background-color: rgba(0, 0, 0, 0.68) !important;
}

.features-card.is-layer-2:hover .features-card-overlay {
  background-color: rgba(0, 0, 0, 0.50) !important;
}

.features-card.is-layer-deep .features-card-overlay {
  background-color: rgba(0, 0, 0, 0.88) !important;
}

/* Layer-specific card border & inset shadow dimming */
.features-card.is-active {
  border-color: rgba(255, 255, 255, 0.95) !important;
}

.features-card.is-layer-1 {
  border-color: rgba(255, 255, 255, 0.18) !important;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 18px 45px -10px rgba(2, 8, 23, 0.7),
    0 8px 20px -5px rgba(15, 23, 42, 0.5) !important;
}

.features-card.is-layer-2 {
  border-color: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 15px 40px -10px rgba(2, 8, 23, 0.8) !important;
}

.features-card.is-layer-deep {
  border-color: rgba(255, 255, 255, 0.03) !important;
  box-shadow: none !important;
}

/* Atmospheric Ambient Backlight behind card */
.features-card::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 10%;
  width: 80%;
  height: 60%;
  background: radial-gradient(ellipse at center, rgba(96, 165, 250, 0.3), rgba(59, 130, 246, 0.08), transparent 70%);
  pointer-events-none;
  z-index: 0;
  border-radius: 9999px;
  filter: blur(35px);
  opacity: 0.85;
}

/* Glass Reflection Sheen across top edge */
.features-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 4%;
  right: 4%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.95) 50%, transparent 100%);
  pointer-events-none;
  z-index: 2;
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.features-card.is-layer-1::after {
  opacity: 0.2;
}

.features-card.is-layer-2::after,
.features-card.is-layer-deep::after {
  opacity: 0;
}

/* Elevated 3D Inner Graphic Box */
.features-graphic-box {
  position: relative;
  background: #FFFFFF;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 0 0 1px rgba(226, 232, 240, 0.7),
    0 2px 4px rgba(15, 23, 42, 0.04),
    0 14px 32px -4px rgba(15, 23, 42, 0.14),
    0 4px 12px -2px rgba(15, 23, 42, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 2;
}
.features-card:hover .features-graphic-box {
  transform: translateY(-2px);
  box-shadow: 
    0 0 0 1px rgba(226, 232, 240, 0.9),
    0 20px 42px -4px rgba(15, 23, 42, 0.18),
    0 6px 16px -2px rgba(15, 23, 42, 0.1);
}

/* Tag Pill with Soft Glass & Glowing Indicator */
.features-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.22);
  color: #1D4ED8;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.06);
  backdrop-filter: blur(4px);
}
.features-card-tag::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background-color: #2563EB;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.7);
  display: inline-block;
  flex-shrink: 0;
}

/* Active card state */
.features-card.is-active {
  cursor: default;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.95) inset,
    0 2px 4px rgba(255, 255, 255, 0.95) inset,
    0 -2px 6px rgba(37, 99, 235, 0.08) inset,
    0 32px 80px -15px rgba(2, 8, 23, 0.8),
    0 16px 36px -8px rgba(37, 99, 235, 0.4) !important;
}

.features-dot {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.features-dot.active {
  width: 2rem !important;
  background-color: #3B82F6 !important;
}

/* ==========================================================================
   FAQs Accordion Section
   ========================================================================== */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-answer {
  grid-template-rows: 1fr;
}

.faq-answer-inner {
  overflow: hidden;
}

.faq-item .faq-icon {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-item {
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

/* ==========================================================================
   Chatbot Widget & Modal/Footer Stacking Hierarchy
   ========================================================================== */
#agileoffice-chatbot-btn,
#agileoffice-chat-message {
  z-index: 25 !important;
}

#site-footer {
  position: relative;
  z-index: 30 !important;
}

#mobile-drawer {
  z-index: 1000 !important;
}

/* Hide chatbot elements completely when mobile drawer modal is open */
body:has(#mobile-drawer:not(.hidden)) #agileoffice-chatbot-btn,
body:has(#mobile-drawer:not(.hidden)) #agileoffice-chat-message,
body:has(#mobile-drawer:not(.hidden)) #agileoffice-chatbot-window {
  display: none !important;
}

/* ==========================================================================
   Contact Section - Responsive Chamfer Cards
   ========================================================================== */
.contact-info-card {
  background-color: #D4E6FA;
  border-radius: 1.5rem;
  border: 1px solid #B9D8FB;
  clip-path: none;
}

.contact-form-card {
  background-color: #F8FBFF;
  border-radius: 1.5rem;
  border: 1px solid #B9D8FB;
  clip-path: none;
}

@media (min-width: 1024px) {
  .contact-info-card {
    border-radius: 0;
    border: none;
    clip-path: polygon(34.751% 1.841%, 65.263% 1.841%, 67.789% 0%, 95.554% 0%, 100% 3.148%, 100% 40.112%, 97.474% 41.953%, 97.474% 58.047%, 100% 59.888%, 100% 96.857%, 95.562% 100%, 76.624% 100%, 74.105% 98.165%, 26.15% 98.165%, 23.632% 100%, 4.438% 100%, 0% 96.857%, 0% 59.888%, 2.526% 58.047%, 2.526% 41.953%, 0% 40.112%, 0% 3.148%, 4.446% 0%, 32.225% 0%, 34.751% 1.841%);
  }

  .contact-form-card {
    border-radius: 0;
    border: 1px solid transparent;
    clip-path: polygon(41.881% 1.841%, 58.239% 1.841%, 59.594% 0%, 97.616% 0%, 100% 3.148%, 100% 40.112%, 98.646% 41.953%, 98.646% 58.047%, 100% 59.888%, 100% 96.857%, 97.621% 100%, 69.296% 100%, 67.946% 98.165%, 32.078% 98.165%, 30.728% 100%, 2.266% 100%, 0% 97.006%, 0% 59.734%, 1.242% 58.047%, 1.242% 41.953%, 0% 40.265%, 0% 2.999%, 2.271% 0%, 40.527% 0%, 41.881% 1.841%);
  }
}

