/**
 * Global CSS Theme System
 * Comprehensive styling for MyPerfectWords PHP Application
 * Includes: CSS Variables, Base Styles, Components, Utilities, and Responsive Design
 */

/* ============================================
   FONT FACES - Poppins Font Family
   ============================================ */

/* Poppins Thin - 100 */
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-Thin.woff2') format('woff2');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-ThinItalic.woff2') format('woff2');
  font-weight: 100;
  font-style: italic;
  font-display: swap;
}

/* Poppins ExtraLight - 200 */
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-ExtraLight.woff2') format('woff2');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-ExtraLightItalic.woff2') format('woff2');
  font-weight: 200;
  font-style: italic;
  font-display: swap;
}

/* Poppins Light - 300 */
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-LightItalic.woff2') format('woff2');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

/* Poppins Regular - 400 */
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* Poppins Medium - 500 */
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-MediumItalic.woff2') format('woff2');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

/* Poppins SemiBold - 600 */
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-SemiBoldItalic.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

/* Poppins Bold - 700 */
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-BoldItalic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* Poppins ExtraBold - 800 */
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-ExtraBoldItalic.woff2') format('woff2');
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

/* Poppins Black - 900 */
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-BlackItalic.woff2') format('woff2');
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

/* ============================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */

:root {
  /* Primary Brand Colors */
  --primary-blue: #0654e6;
  --primary-blue-dark: #002770;
  --primary-blue-light: #1176ca;
  --primary-blue-hover: #2088df;
  --primary-blue-lighter: #2d96ee;

  /* Text Colors */
  --text-primary: #1b1a2e;
  --text-secondary: #231f20;
  --text-tertiary: #464860;
  --text-gray: #5e5e5e;
  --text-gray-lightv2: #575e62;
  --text-gray-light: #60738A;
  --text-gray-lighter: #64748b;
  --text-muted: #92abc9;
  --text-heading-dark: #213D56;
  --text-muted-blue: #546B8E;

  /* Background Colors */
  --bg-white: #fff;
  --bg-light-blue: #f5faff;
  --bg-lighter-blue: #f5f9ff;
  --bg-lightest-blue: #e5efff;
  --bg-pale-blue: #f0f5fe;

  /* Border Colors */
  --border-light: #c8d9ee;
  --border-lighter: #cfdef0;
  --border-lightest: #cee4fd;
  --border-hover: #1176ca;

  /* Status Colors */
  --success: #22c55e;
  --error: #ee2424;

  /* Font Weights */
  --font-regular: 400;
  --font-medium: 450;
  --font-semi: 500;
  --font-bold: 600;
  --font-extra-bold: 700;

  /* Font Sizes */
  --text-xs: 13px;
  --text-sm: 14px;
  --text-normal: 15px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 32px;
  --text-3xl-lg: 38px;
  --text-4xl: 48px;

  /* Line Heights */
  --leading-tight: 120%;
  --leading-normal: 150%;
  --leading-relaxed: 170%;

  /* Spacing Scale */
  --space-xs: 10px;
  --space-sm: 15px;
  --space-md: 20px;
  --space-lg: 30px;
  --space-xl: 40px;
  --space-2xl: 60px;
  --space-3xl: 80px;
  --space-4xl: 100px;

  /* Section Spacing */
  --section-padding: 100px 0;
  --section-padding-mobile: 60px 0;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 100px;
  --radius-circle: 50%;

  /* Shadows */
  --shadow-sm: 0px 1px 16px 0px rgba(54, 127, 211, 0.18);
  --shadow-md: 0px 0px 16px 0px rgba(70, 159, 223, 0.2);
  --shadow-lg: 0px 3px 20px 0px rgba(15, 56, 112, 0.15);
  --shadow-header: 0 3px 10px rgba(0, 0, 0, 0.2);

  /* Transitions */
  --transition-fast: all 0.2s ease;
  --transition-normal: all 0.3s ease;
}

/* ============================================
   2. GLOBAL RESET & BASE STYLES
   ============================================ */

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

/* Body Base Styles */
body {
  font-family: 'Poppins';
  overflow-x: hidden;
  min-height: 100vh;
  color: var(--text-gray-light);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  line-height: var(--leading-normal);
}

/* Link Styles */
a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--primary-blue-lighter);
}

/* Image Styles */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Strong Text */
strong {
  font-weight: var(--font-bold);
}

/* ============================================
   3. CONTAINER SYSTEM
   ============================================ */

.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 15px;
}

.container-wide {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 15px;
}

.container-narrow {
  max-width: 1075px;
  width: 100%;
  margin: 0 auto;
  padding: 0 15px;
}

/* ============================================
   4. TYPOGRAPHY SYSTEM
   ============================================ */

/* Headings */
h1,
.heading-xl {
  font-size: 35px;
  font-weight: var(--font-medium);
  line-height: 1.5;
  color: var(--text-tertiary);
}

h2,
.heading-lg {
  font-size: 32px;
  font-weight: var(--font-regular);
  line-height: 1.3;
  color: var(--text-tertiary);
}

h3,
.heading-md {
  font-size: 22px;
  font-weight: var(--font-semi);
  line-height: 1.4;
  color: var(--text-secondary);
}

h4,
.heading-sm {
  font-size: 20px;
  font-weight: var(--font-semi);
  line-height: 1.4;
  color: var(--text-secondary);
}

/* Paragraph Styles */
p {
  color: var(--text-gray-light);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  line-height: var(--leading-normal);
}

/* Text Size Utilities */
.text-lg {
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
}

.text-sm {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.text-xs {
  font-size: var(--text-xs);
}

/* Text Color Utilities */
.text-primary {
  color: var(--text-primary);
}

.text-gray {
  color: var(--text-gray);
}

.text-muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

/* Font Weight Utilities */
.font-medium {
  font-weight: var(--font-medium);
}

.font-semi {
  font-weight: var(--font-semi);
}

.font-bold {
  font-weight: var(--font-bold);
}

/* Mobile Typography */
@media (max-width: 767px) {
  h1,
  .heading-xl {
    font-size: 30px;
  }

  h2,
  .heading-lg {
    font-size: 24px;
  }

  h3,
  .heading-md {
    font-size: 20px;
  }

  h4,
  .heading-sm {
    font-size: 18px;
  }
}

/* ============================================
   5. BUTTON COMPONENTS
   ============================================ */

/* Primary Button (Custom Button) */
.custom-btn {
  background: var(--primary-blue);
  border-radius: var(--radius-md);
  max-width: max-content;
  width: auto;
  height: auto;
  padding: 10px 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-semi);
  font-size: var(--text-sm);
  line-height: 1;
  color: var(--bg-white);
  text-align: center;
  border: 1px solid var(--primary-blue);
  border-bottom: 4px solid var(--primary-blue-dark);
  transition: var(--transition-normal);
  cursor: pointer;
}

.custom-btn:hover {
  transform: translateY(-4px);
  color: var(--bg-white);
}

.custom-btn:active {
  transform: translateY(0);
}

/* Secondary Button (Inverted) */
.custom-btn-inverted {
  background: transparent;
  border-radius: var(--radius-md);
  height: 49px;
  max-width: max-content;
  padding: 0 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-semi);
  font-size: var(--text-sm);
  line-height: 1;
  color: var(--primary-blue);
  text-align: center;
  border: 1px solid var(--primary-blue);
  transition: var(--transition-normal);
  cursor: pointer;
}

.custom-btn-inverted:hover {
  transform: translateY(-4px);
  background: var(--primary-blue);
  color: var(--bg-white);
}

/* Order CTA Button */
.order-btn {
  background: var(--primary-blue-light);
  border: 1px solid var(--primary-blue-light);
  padding: 17px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--text-lg);
  color: var(--bg-white);
  font-weight: var(--font-semi);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: max-content;
  cursor: pointer;
  transition: var(--transition-fast);
}

.order-btn:hover {
  background-color: var(--primary-blue-hover);
  border-color: var(--primary-blue-hover);
  color: var(--bg-white);
}

/* Link Button (Outlined) */
.btn-outline {
  display: inline-block;
  padding: 15px 30px;
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  border-radius: 7px;
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
  transition: var(--transition-fast);
  cursor: pointer;
}

.btn-outline:hover {
  color: var(--primary-blue-light);
  border-color: var(--primary-blue-light);
}

/* Mobile Button Adjustments */
@media (max-width: 767px) {
  .order-btn {
    font-size: var(--text-base);
    padding: 15px 30px;
  }
}


/* ============================================
   7. FORM ELEMENTS
   ============================================ */

/* Input Fields */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  background-color: var(--bg-lighter-blue);
  transition: var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary-blue-light);
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--primary-blue-light);
}

/* Textarea Specific */
textarea {
  min-height: 120px;
  resize: vertical;
}

/* Label Styles */
label {
  font-size: var(--text-sm);
  font-weight: var(--font-semi);
  color: var(--text-primary);
  display: block;
  margin-bottom: 8px;
}

/* Select Dropdown with Custom Arrow */
select {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%235e5e5e" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 40px;
  cursor: pointer;
}

/* ============================================
   8. LAYOUT UTILITIES
   ============================================ */

/* Flexbox Utilities */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

/* Gap Utilities */
.gap-xs {
  gap: var(--space-xs);
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

.gap-xl {
  gap: var(--space-xl);
}

/* Spacing Utilities - Margin */
.mt-auto {
  margin-top: auto;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.mb-sm {
  margin-bottom: var(--space-sm);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.mb-xl {
  margin-bottom: var(--space-xl);
}

/* Spacing Utilities - Padding */
.pb-lg {
  padding-bottom: var(--space-lg);
}

.py-lg {
  padding-top: var(--space-lg);
  padding-bottom: var(--space-lg);
}

/* ============================================
   9. SECTION PATTERNS
   ============================================ */

/* Section Wrapper */
section {
  padding: var(--section-padding);
}

section.section-sm {
  padding: 80px 0;
}

section.section-xs {
  padding: 60px 0;
}

/* Background Variants */
.bg-gradient-light {
  background: linear-gradient(136.79deg, #FEFEFF 24.22%, #EBF7FF 88.85%);
}

.bg-light-blue {
  background-color: var(--bg-lighter-blue);
}

.bg-white {
  background-color: var(--bg-white);
}

/* Mobile Section Padding */
@media (max-width: 767px) {
  section {
    padding: var(--section-padding-mobile);
  }

  section.section-sm {
    padding: 50px 0;
  }

  section.section-xs {
    padding: 40px 0;
  }
}

/* ============================================
   10. ANIMATIONS & HOVER EFFECTS
   ============================================ */

/* Hover Scale Effect */
.hover-scale {
  transition: var(--transition-normal);
}

.hover-scale:hover {
  transform: scale(1.04);
}

/* Hover Translate Effect */
.hover-translate {
  transition: var(--transition-normal);
}

.hover-translate:hover {
  transform: translateY(-4px);
}

/* Hover Shadow Effect */
.hover-shadow {
  transition: var(--transition-normal);
}

.hover-shadow:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

/* Pulse Animation */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0px rgba(6, 84, 230, 0.5);
  }
  100% {
    box-shadow: 0 0 0 20px rgba(6, 84, 230, 0);
  }
}

.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* ============================================
   11. RESPONSIVE & HELPER UTILITIES
   ============================================ */

/* Responsive Visibility */
@media (max-width: 991px) {
  .hide-tablet {
    display: none;
  }
}

@media (max-width: 767px) {
  .hide-mobile {
    display: none;
  }

  .flex-mobile-column {
    flex-direction: column;
  }

  .text-mobile-center {
    text-align: center;
  }
}

/* Overflow & Position */
.overflow-hidden {
  overflow: hidden;
}

.position-relative {
  position: relative;
}

.position-absolute {
  position: absolute;
}

/* Width Utilities */
.w-full {
  width: 100%;
}

.max-w-content {
  max-width: max-content;
}

/* Display Utilities */
.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

/* Cursor */
.cursor-pointer {
  cursor: pointer;
}

/* Border Radius Utilities */
.border-radius-sm {
  border-radius: var(--radius-sm);
}

.border-radius-md {
  border-radius: var(--radius-md);
}

.border-radius-lg {
  border-radius: var(--radius-lg);
}

.border-radius-xl {
  border-radius: var(--radius-xl);
}

/* Shadow Utilities */
.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}
