/* ==========================================================================
   MORPHY CHESS ACADEMY - DESIGN SYSTEM & GLOBAL STYLES
   ========================================================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Inter:wght@300;400;500;600;700&display=swap');

/* Component Imports */
@import url('components/navigation.css');
@import url('components/hero.css');
@import url('components/hero-designs.css');
@import url('components/story.css');
@import url('components/journey.css');
@import url('components/sections.css');
@import url('components/modal.css');
@import url('components/about.css');
@import url('components/courses.css');
@import url('components/blogs.css');
@import url('components/contact.css');
@import url('components/faq.css');
@import url('components/legal.css');

/* ==========================================================================
   DESIGN TOKENS (CSS VARIABLES)
   ========================================================================== */
:root {
  /* Color Palette */
  --bg-primary: #FCFCFB;
  --bg-surface: #F6F8FA;
  --bg-surface-secondary: #F1F5F9;
  --text-primary: #1C2434; /* Premium dark navy */
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;
  
  /* Premium Brand Accents */
  --chess-green: #1a365d;
  --chess-green-rgb: 26, 54, 93;
  --chess-green-light: #e2e8f0;
  --chess-green-hover: #2c5282;
  --premium-gold: #FFE58A;
  --premium-gold-rgb: 255, 229, 138;
  --warm-yellow: #FFE58A;
  --soft-navy: #1C2434;
  --border-color: rgba(28, 36, 52, 0.06);
  
  /* Font Family */
  --font-primary: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Typography Scale */
  --font-size-hero: clamp(2.2rem, 4.5vw + 1rem, 4.5rem);
  --font-size-display: clamp(2rem, 4vw + 1rem, 4.5rem);
  --font-size-h1: clamp(1.8rem, 3vw + 1rem, 3.5rem);
  --font-size-h2: clamp(1.5rem, 2.5vw + 0.8rem, 2.6rem);
  --font-size-h3: clamp(1.2rem, 1.8vw + 0.5rem, 2rem);
  --font-size-body: 1.125rem; /* 18px */
  --font-size-body-sm: 0.95rem; /* ~15px */
  --font-size-caption: 0.875rem; /* 14px */
  
  /* Spacing System */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3.5rem;
  --spacing-xl: 4.5rem;
  --spacing-xxl: 5.5rem;
  
  /* Layout Grid */
  --container-max-width: 1440px;
  --container-padding: clamp(1.5rem, 5vw, 6rem);
  
  /* Motion & Easing */
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  
  --duration-fast: 250ms;
  --duration-normal: 400ms;
  --duration-slow: 700ms;
  --duration-story: 1200ms;
  
  /* Z-Index Architecture */
  --z-index-background: -10;
  --z-index-base: 1;
  --z-index-parallax: 5;
  --z-index-navigation: 100;
  --z-index-cursor: 9999;
}

/* ==========================================================================
   RESET & SYSTEM BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
}

body {
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
  position: relative;
  background-color: var(--bg-primary);
}

img, svg, video {
  max-width: 100%;
  height: auto;
}

/* Remove default focus outlines but style custom keyboard states for WCAG */
*:focus {
  outline: none;
}

body.keyboard-user *:focus-visible {
  outline: 2px solid var(--chess-green);
  outline-offset: 4px;
}

/* Selection colors */
::selection {
  background-color: var(--chess-green-light);
  color: var(--chess-green);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-surface);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

p {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: var(--font-size-body);
  letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out-quart);
}

/* ==========================================================================
   LAYOUT CONVENTIONS & UTILITIES
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* Full height sections for storytelling scroll experience */
.fullscreen-section {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--bg-primary);
  padding: var(--spacing-lg) 0;
}

/* Horizontal borders - premium hairline design */
.hairline-border-top {
  border-top: 1px solid var(--border-color);
}
.hairline-border-bottom {
  border-bottom: 1px solid var(--border-color);
}

/* Elegant Text Gradients */
.text-gradient-gold {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--premium-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-green {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--chess-green) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Button Foundation */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.25rem;
  font-size: var(--font-size-body-sm);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 0; /* Premium editorial sharp corners */
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-expo);
  outline: none;
  background: transparent;
}

/* Primary Button Design (Solid Black/Dark Green) */
.btn-primary {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--chess-green);
  transform: translateY(100%);
  transition: transform var(--duration-normal) var(--ease-expo);
  z-index: 1;
}

.btn-primary > span {
  position: relative;
  z-index: 2;
}

.btn-primary:hover {
  border-color: var(--chess-green);
}

.btn-primary:hover::before {
  transform: translateY(0);
}

/* Secondary Button Design (Ghost / Outline) */
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--warm-gray);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-normal) var(--ease-expo);
  z-index: 1;
}

.btn-secondary > span {
  position: relative;
  z-index: 2;
}

.btn-secondary:hover {
  border-color: var(--text-primary);
}

.btn-secondary:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

/* Button Arrow Micro-animation */
.btn .arrow-icon {
  margin-left: 0.75rem;
  transition: transform var(--duration-normal) var(--ease-expo);
  display: inline-block;
  vertical-align: middle;
}

.btn:hover .arrow-icon {
  transform: translateX(6px);
}

/* ==========================================================================
   CUSTOM MOUSE CURSOR
   ========================================================================== */
.custom-cursor {
  width: var(--cursor-size);
  height: var(--cursor-size);
  border: 1px solid rgba(27, 27, 27, 0.4);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: var(--z-index-cursor);
  transition: width 0.3s var(--ease-expo), height 0.3s var(--ease-expo), background-color 0.3s var(--ease-expo), border-color 0.3s var(--ease-expo);
}

.custom-cursor-dot {
  width: 4px;
  height: 4px;
  background-color: var(--text-primary);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: var(--z-index-cursor);
  transition: transform 0.15s var(--ease-out-quart);
}

/* Custom cursor hover interaction states */
.custom-cursor.hovering {
  width: 60px;
  height: 60px;
  background-color: rgba(19, 80, 60, 0.08);
  border-color: var(--chess-green);
}

.custom-cursor.hovering-link {
  width: 40px;
  height: 40px;
  background-color: rgba(27, 27, 27, 0.04);
  border-color: var(--text-primary);
}

.custom-cursor-dot.hovering {
  transform: translate(-50%, -50%) scale(0);
}

/* ==========================================================================
   MEDIA QUERIES FOR STRUCTURE
   ========================================================================== */
@media (max-width: 1024px) {
  :root {
    --container-padding: 2rem;
  }
  .btn {
    padding: 0.85rem 1.85rem;
  }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 1.25rem;
  }
  /* Hide custom cursor on touch devices */
  .custom-cursor, .custom-cursor-dot {
    display: none !important;
  }
}

@media (max-width: 480px) {
  :root {
    --container-padding: 1rem;
  }
}

/* ==========================================================================
   FLOATING CONTACT WIDGET (CALL & WHATSAPP)
   ========================================================================== */
.floating-contact-widget {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 999;
}

.floating-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  transition: transform var(--duration-normal) var(--ease-out-quart), box-shadow var(--duration-normal) var(--ease-out-quart);
}

.floating-btn svg {
  transition: transform var(--duration-normal) var(--ease-out-quart);
}

.btn-call {
  background-color: #3B82F6;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-whatsapp {
  background-color: #25D366;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.floating-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.25);
  color: #FFFFFF;
}

.floating-btn:hover svg {
  transform: scale(1.08);
}

@media (max-width: 768px) {
  .floating-contact-widget {
    right: 1.25rem;
    bottom: 1.25rem;
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    gap: 0.65rem;
    z-index: 9999;
  }
  .floating-btn {
    width: 48px;
    height: 48px;
  }
  .floating-btn svg {
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 480px) {
  .floating-contact-widget {
    right: 1rem;
    bottom: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    gap: 0.5rem;
  }
  .floating-btn {
    width: 44px;
    height: 44px;
  }
  .floating-btn svg {
    width: 20px;
    height: 20px;
  }
}

/* Scroll Lock active when modals or mobile menus are opened */
html.modal-open,
body.modal-open {
  overflow: hidden !important;
  touch-action: none;
}
