/* ============================================
   FABSEI DESIGN SYSTEM
   Centralized styling for modern, consistent UI
   ============================================ */

/* ============================================
   1. CSS VARIABLES - SINGLE SOURCE OF TRUTH
   ============================================ */
:root {
  /* Color Palette - Primary */
  --color-bg-primary: #b0d3d4; /*#e3d7c6;*/
  --color-bg-secondary: #f5f0e8;
  --color-bg-tertiary: #d4c5b0;

  /* Color Palette - Accent */
  --color-accent-primary: #587b7f;
  --color-accent-secondary: #6a9397;
  --color-accent-tertiary: #244142;
  --color-accent-light: #7fa9ad;

  /* Color Palette - Dark Elements */
  --color-dark-primary: #343a40;
  --color-dark-secondary: #1a1d20;

  /* Text Colors */
  --color-text-primary: #333333;
  --color-text-secondary: #666666;
  --color-text-light: #999999;
  --color-text-white: #ffffff;
  --color-text-muted: #e0e0e0;

  /* Gradients - Background */
  --gradient-bg-main: linear-gradient(135deg, #e3d7c6 0%, #f5f0e8 50%, #e8dcc9 100%);
  --gradient-bg-subtle: linear-gradient(180deg, #e3d7c6 0%, #f5f0e8 100%);
  --gradient-bg-reverse: linear-gradient(135deg, #f5f0e8 0%, #e3d7c6 100%);

  /* Gradients - Accent */
  --gradient-accent: linear-gradient(135deg, #587b7f 0%, #6a9397 100%);
  --gradient-accent-hover: linear-gradient(135deg, #6a9397 0%, #7fa9ad 100%);
  --gradient-accent-vertical: linear-gradient(180deg, #587b7f 0%, #244142 100%);

  /* Gradients - Dark */
  --gradient-dark: linear-gradient(135deg, #343a40 0%, #1a1d20 100%);
  --gradient-dark-reverse: linear-gradient(135deg, #1a1d20 0%, #343a40 100%);

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.2);
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.06);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-blur: blur(10px);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

  /* Z-index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal: 1040;
  --z-popover: 1050;
  --z-tooltip: 1060;
}


/* ============================================
   2. GLOBAL STYLES
   ============================================ */
body {
  background: var(--gradient-bg-main);
  background-attachment: fixed;
  color: var(--color-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection color */
::selection {
  background-color: var(--color-accent-primary);
  color: var(--color-text-white);
}


/* ============================================
   3. COMPONENT CLASSES - CARDS
   ============================================ */

/* Modern Card Base */
.fabsei-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Ensure card body doesn't break rounded corners */
.fabsei-card .card-body,
.fabsei-card-gradient .card-body,
.fabsei-card-accent .card-body {
  position: relative;
  z-index: 1;
}

.fabsei-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-accent-light);
}

.fabsei-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Card with gradient header */
.fabsei-card-gradient {
  background: linear-gradient(180deg, rgba(88, 123, 127, 0.4) 0%, rgba(127, 169, 173, 0.2) 50%, rgba(255, 255, 255, 0.8) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(88, 123, 127, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fabsei-card-gradient:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  background: linear-gradient(180deg, rgba(88, 123, 127, 0.5) 0%, rgba(127, 169, 173, 0.3) 50%, rgba(255, 255, 255, 0.85) 100%);
}

.fabsei-card-gradient .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Card with accent border */
.fabsei-card-accent {
  position: relative;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

.fabsei-card-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-accent);
  z-index: 1;
}

.fabsei-card-accent:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.fabsei-card-accent .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.fabsei-card-accent .card-footer {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(88, 123, 127, 0.2);
}


/* ============================================
   4. COMPONENT CLASSES - BUTTONS
   ============================================ */

/* Primary Button */
.fabsei-btn-primary {
  background: var(--gradient-accent);
  color: var(--color-text-white);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  display: inline-block;
}

.fabsei-btn-primary:hover {
  background: var(--gradient-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--color-text-white);
  text-decoration: none;
}

/* Secondary Button */
.fabsei-btn-secondary {
  background: transparent;
  color: var(--color-accent-primary);
  padding: var(--space-sm) var(--space-lg);
  border: 2px solid var(--color-accent-primary);
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  display: inline-block;
}

.fabsei-btn-secondary:hover {
  background: var(--color-accent-primary);
  color: var(--color-text-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

/* Icon Button */
.fabsei-btn-icon {
  background: rgba(255, 255, 255, 0.8);
  color: var(--color-accent-primary);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-accent-light);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.fabsei-btn-icon:hover {
  background: var(--color-accent-primary);
  color: var(--color-text-white);
  transform: scale(1.1);
}


/* ============================================
   5. COMPONENT CLASSES - BADGES
   ============================================ */

.fabsei-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.fabsei-badge-primary {
  background: var(--gradient-accent);
  color: var(--color-text-white);
}

.fabsei-badge-secondary {
  background: rgba(108, 117, 125, 0.1);
  color: var(--color-text-secondary);
  border: 1px solid rgba(108, 117, 125, 0.2);
}

.fabsei-badge-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: var(--color-text-white);
}

.fabsei-badge-info {
  background: linear-gradient(135deg, #17a2b8 0%, #3fc5d8 100%);
  color: var(--color-text-white);
}

.fabsei-badge-warning {
  background: linear-gradient(135deg, #ffc107 0%, #ffda6a 100%);
  color: var(--color-text-primary);
}


/* ============================================
   6. COMPONENT CLASSES - HEADINGS
   ============================================ */

.fabsei-heading-1 {
  color: var(--color-accent-tertiary);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  line-height: 1.4;
  padding-bottom: 0.1em;
  background: var(--gradient-accent-vertical);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.fabsei-heading-2 {
  color: var(--color-accent-primary);
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  line-height: 1.3;
}

.fabsei-heading-3 {
  color: var(--color-accent-tertiary);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  line-height: 1.4;
}


/* ============================================
   7. COMPONENT CLASSES - CONTAINERS
   ============================================ */

.fabsei-section {
  padding: var(--space-3xl) 0;
}

.fabsei-section-alt {
  background: var(--gradient-bg-reverse);
  padding: var(--space-3xl) 0;
}

.fabsei-container-glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg);
}


/* ============================================
   8. COMPONENT CLASSES - IMAGES
   ============================================ */

.fabsei-img-rounded {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.fabsei-img-rounded:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.fabsei-img-featured {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: block;
  margin: 0;
}

/* For featured images in accent cards, position right below the accent border */
.fabsei-card-accent .fabsei-img-featured {
  position: relative;
  top: 0;
  margin: 0;
  border-radius: 0; /* No radius needed since it's inside the card */
}

/* Ensure card with image has no padding at top */
.fabsei-card-accent > img:first-child {
  margin: 0;
  padding: 0;
}


/* ============================================
   9. COMPONENT CLASSES - LINKS
   ============================================ */

.fabsei-link {
  color: var(--color-accent-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}

.fabsei-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-accent);
  transition: width var(--transition-base);
}

.fabsei-link:hover {
  color: var(--color-accent-secondary);
}

.fabsei-link:hover::after {
  width: 100%;
}


/* ============================================
   10. UTILITY CLASSES
   ============================================ */

/* Spacing */
.mt-fabsei { margin-top: var(--space-2xl); }
.mb-fabsei { margin-bottom: var(--space-2xl); }
.pt-fabsei { padding-top: var(--space-2xl); }
.pb-fabsei { padding-bottom: var(--space-2xl); }

/* Text */
.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-accent { color: var(--color-accent-primary); }
.text-muted { color: var(--color-text-secondary); }
.text-readable { color: #2c3e50; } /* Dark blue-gray for better readability */
.text-readable-muted { color: #34495e; } /* Slightly muted but still readable */

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp var(--transition-slow) ease-out;
}

/* Hover Effects */
.hover-lift {
  transition: transform var(--transition-base);
}

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


/* ============================================
   11. RESPONSIVE BREAKPOINTS
   ============================================ */

@media (max-width: 768px) {
  .fabsei-heading-1 { font-size: 2rem; }
  .fabsei-heading-2 { font-size: 1.5rem; }
  .fabsei-heading-3 { font-size: 1.25rem; }
  .fabsei-section { padding: var(--space-2xl) 0; }
}
