/**
 * NSIA Design System
 * Based on Public Portal Wireframes v3
 *
 * This file establishes the design tokens and base component styles
 * that match the wireframe specifications.
 */

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
  /* Primary Colors */
  --w-primary: #1a5f2a;
  --w-primary-dark: #0d3d18;
  --w-primary-light: #2d8a3e;
  --w-accent: #e94560;
  --w-accent-hover: #d63851;

  /* Neutral Colors */
  --w-white: #ffffff;
  --w-gray-50: #f8f9fa;
  --w-gray-100: #f0f0f0;
  --w-gray-200: #eee;
  --w-gray-300: #ddd;
  --w-gray-400: #ccc;
  --w-gray-500: #888;
  --w-gray-600: #666;
  --w-gray-700: #454545;
  --w-gray-800: #333;
  --w-gray-900: #1a1a1a;

  /* Event Category Colors */
  --w-religious-bg: #e8f5e9;
  --w-religious-text: #2e7d32;
  --w-family-bg: #fff3e0;
  --w-family-text: #ef6c00;
  --w-youth-bg: #e3f2fd;
  --w-youth-text: #1565c0;
  --w-education-bg: #fce4ec;
  --w-education-text: #c2185b;
  --w-social-bg: #f3e5f5;
  --w-social-text: #7b1fa2;

  /* Status Colors */
  --w-success: #4caf50;
  --w-success-bg: #e8f5e9;
  --w-warning: #ff9800;
  --w-warning-bg: #fff3e0;
  --w-error: #f44336;
  --w-error-bg: #ffebee;
  --w-info: #2196f3;
  --w-info-bg: #e3f2fd;

  /* Typography */
  --w-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --w-font-size-xs: 11px;
  --w-font-size-sm: 13px;
  --w-font-size-base: 14px;
  --w-font-size-md: 16px;
  --w-font-size-lg: 18px;
  --w-font-size-xl: 20px;
  --w-font-size-2xl: 24px;
  --w-font-size-3xl: 28px;
  --w-font-size-4xl: 32px;
  --w-font-size-5xl: 36px;
  --w-font-size-countdown: 64px;

  --w-font-weight-normal: 400;
  --w-font-weight-medium: 500;
  --w-font-weight-semibold: 600;
  --w-font-weight-bold: 700;

  --w-line-height-tight: 1.2;
  --w-line-height-normal: 1.5;
  --w-line-height-relaxed: 1.8;

  /* Spacing */
  --w-space-xs: 4px;
  --w-space-sm: 8px;
  --w-space-md: 12px;
  --w-space-lg: 16px;
  --w-space-xl: 20px;
  --w-space-2xl: 24px;
  --w-space-3xl: 30px;
  --w-space-4xl: 40px;
  --w-space-5xl: 50px;
  --w-space-6xl: 60px;

  /* Border Radius */
  --w-radius-sm: 4px;
  --w-radius-md: 6px;
  --w-radius-lg: 8px;
  --w-radius-xl: 12px;
  --w-radius-2xl: 15px;
  --w-radius-full: 20px;
  --w-radius-circle: 50%;

  /* Shadows */
  --w-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --w-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --w-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
  --w-shadow-xl: 0 10px 25px rgba(0, 0, 0, 0.15);
  --w-shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
  --w-shadow-card-hover: 0 8px 25px rgba(0, 0, 0, 0.12);

  /* Transitions */
  --w-transition-fast: 150ms ease;
  --w-transition-normal: 200ms ease;
  --w-transition-slow: 300ms ease;

  /* Z-Index Scale */
  --w-z-dropdown: 100;
  --w-z-sticky: 200;
  --w-z-fixed: 300;
  --w-z-modal-backdrop: 400;
  --w-z-modal: 500;
  --w-z-tooltip: 600;

  /* Container Widths */
  --w-container-sm: 600px;
  --w-container-md: 800px;
  --w-container-lg: 1000px;
  --w-container-xl: 1200px;
  --w-container-max: 1400px;
}

/* ==========================================================================
   Base Button Styles
   ========================================================================== */

.w-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--w-space-sm);
  padding: 12px 24px;
  font-family: var(--w-font-family);
  font-size: var(--w-font-size-base);
  font-weight: var(--w-font-weight-medium);
  line-height: 1;
  text-decoration: none;
  color: var(--w-white);
  background: var(--w-accent);
  border: none;
  border-radius: var(--w-radius-md);
  cursor: pointer;
  transition: all var(--w-transition-normal);
}

.w-btn:hover {
  background: var(--w-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--w-shadow-md);
}

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

.w-btn--primary {
  background: var(--w-primary);
}

.w-btn--primary:hover {
  background: var(--w-primary-dark);
}

.w-btn--outline {
  background: transparent;
  color: var(--w-primary);
  border: 2px solid var(--w-primary);
}

.w-btn--outline:hover {
  background: var(--w-primary);
  color: var(--w-white);
}

.w-btn--sm {
  padding: 8px 16px;
  font-size: var(--w-font-size-sm);
}

.w-btn--lg {
  padding: 15px 30px;
  font-size: var(--w-font-size-md);
}

.w-btn--block {
  width: 100%;
}

/* ==========================================================================
   Card Styles
   ========================================================================== */

.w-card {
  background: var(--w-white);
  border-radius: var(--w-radius-lg);
  box-shadow: var(--w-shadow-card);
  overflow: hidden;
  transition: all var(--w-transition-normal);
}

.w-card:hover {
  box-shadow: var(--w-shadow-card-hover);
}

.w-card--interactive:hover {
  transform: translateY(-4px);
}

.w-card__image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: linear-gradient(45deg, var(--w-gray-100), var(--w-gray-200));
}

.w-card__body {
  padding: var(--w-space-xl);
}

.w-card__title {
  font-size: var(--w-font-size-lg);
  font-weight: var(--w-font-weight-semibold);
  color: var(--w-gray-800);
  margin: 0 0 var(--w-space-sm);
}

.w-card__text {
  font-size: var(--w-font-size-base);
  color: var(--w-gray-600);
  line-height: var(--w-line-height-normal);
}

/* ==========================================================================
   Event Badge Styles
   ========================================================================== */

.w-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: var(--w-font-size-xs);
  font-weight: var(--w-font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--w-radius-sm);
}

.w-badge--religious {
  background: var(--w-religious-bg);
  color: var(--w-religious-text);
}

.w-badge--family {
  background: var(--w-family-bg);
  color: var(--w-family-text);
}

.w-badge--youth {
  background: var(--w-youth-bg);
  color: var(--w-youth-text);
}

.w-badge--education {
  background: var(--w-education-bg);
  color: var(--w-education-text);
}

.w-badge--social {
  background: var(--w-social-bg);
  color: var(--w-social-text);
}

/* Status badges */
.w-badge--success {
  background: var(--w-success-bg);
  color: var(--w-success);
}

.w-badge--warning {
  background: var(--w-warning-bg);
  color: var(--w-warning);
}

.w-badge--error {
  background: var(--w-error-bg);
  color: var(--w-error);
}

/* ==========================================================================
   Section Styles
   ========================================================================== */

.w-section {
  padding: var(--w-space-5xl) var(--w-space-4xl);
}

.w-section--gray {
  background: var(--w-gray-50);
}

.w-section--white {
  background: var(--w-white);
}

.w-section--primary {
  background: linear-gradient(135deg, var(--w-primary) 0%, var(--w-primary-dark) 100%);
  color: var(--w-white);
}

.w-section__title {
  font-size: var(--w-font-size-2xl);
  font-weight: var(--w-font-weight-semibold);
  color: var(--w-primary);
  margin-bottom: var(--w-space-xl);
}

/* ==========================================================================
   Grid System
   ========================================================================== */

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

.w-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.w-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.w-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.w-grid--auto {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

@media (max-width: 992px) {
  .w-grid--3,
  .w-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .w-grid--2,
  .w-grid--3,
  .w-grid--4 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

.w-label {
  display: block;
  font-size: var(--w-font-size-sm);
  font-weight: var(--w-font-weight-medium);
  color: var(--w-gray-700);
  margin-bottom: var(--w-space-sm);
}

.w-input,
.w-select,
.w-textarea {
  display: block;
  width: 100%;
  padding: 12px 15px;
  font-family: var(--w-font-family);
  font-size: var(--w-font-size-base);
  color: var(--w-gray-800);
  background: var(--w-white);
  border: 1px solid var(--w-gray-300);
  border-radius: var(--w-radius-md);
  transition: border-color var(--w-transition-fast), box-shadow var(--w-transition-fast);
  margin-bottom: var(--w-space-lg);
}

.w-input:focus,
.w-select:focus,
.w-textarea:focus {
  outline: none;
  border-color: var(--w-primary);
  box-shadow: 0 0 0 3px rgba(26, 95, 42, 0.1);
}

.w-input::placeholder {
  color: var(--w-gray-500);
}

/* ==========================================================================
   Tab Navigation
   ========================================================================== */

.w-tabs {
  display: flex;
  gap: var(--w-space-sm);
  margin-bottom: var(--w-space-2xl);
  border-bottom: 2px solid var(--w-gray-200);
  padding-bottom: 0;
}

.w-tab {
  padding: var(--w-space-md) var(--w-space-xl);
  font-size: var(--w-font-size-base);
  font-weight: var(--w-font-weight-medium);
  color: var(--w-gray-600);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--w-transition-fast);
}

.w-tab:hover {
  color: var(--w-primary);
}

.w-tab.active {
  color: var(--w-primary);
  border-bottom-color: var(--w-primary);
}

/* ==========================================================================
   Progress Steps (Multi-step forms)
   ========================================================================== */

.w-steps {
  display: flex;
  justify-content: center;
  gap: var(--w-space-4xl);
  margin-bottom: var(--w-space-3xl);
}

.w-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--w-space-sm);
  position: relative;
}

.w-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: calc(50% + 20px);
  width: calc(100% + var(--w-space-4xl) - 40px);
  height: 2px;
  background: var(--w-gray-300);
}

.w-step.completed:not(:last-child)::after {
  background: var(--w-primary);
}

.w-step__circle {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--w-font-size-sm);
  font-weight: var(--w-font-weight-semibold);
  color: var(--w-gray-500);
  background: var(--w-white);
  border: 2px solid var(--w-gray-300);
  border-radius: var(--w-radius-circle);
  position: relative;
  z-index: 1;
}

.w-step.active .w-step__circle {
  color: var(--w-white);
  background: var(--w-primary);
  border-color: var(--w-primary);
}

.w-step.completed .w-step__circle {
  color: var(--w-white);
  background: var(--w-success);
  border-color: var(--w-success);
}

.w-step__label {
  font-size: var(--w-font-size-sm);
  color: var(--w-gray-500);
}

.w-step.active .w-step__label {
  color: var(--w-primary);
  font-weight: var(--w-font-weight-medium);
}

/* ==========================================================================
   Status Dots
   ========================================================================== */

.w-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--w-radius-circle);
  margin-right: var(--w-space-sm);
}

.w-status-dot--green {
  background: var(--w-success);
}

.w-status-dot--orange {
  background: var(--w-warning);
}

.w-status-dot--red {
  background: var(--w-error);
}

/* ==========================================================================
   Prayer Bar
   ========================================================================== */

.w-prayer-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--w-space-3xl);
  padding: var(--w-space-md) var(--w-space-xl);
  background: var(--w-primary-dark);
  color: var(--w-white);
  font-size: var(--w-font-size-sm);
}

.w-prayer-bar__item {
  opacity: 0.8;
}

.w-prayer-bar__item--current {
  opacity: 1;
  font-weight: var(--w-font-weight-semibold);
  color: #ffd700;
}

/* ==========================================================================
   Top Bar / Header
   ========================================================================== */

.w-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--w-space-lg) var(--w-space-3xl);
  background: linear-gradient(135deg, var(--w-primary) 0%, var(--w-primary-light) 100%);
  color: var(--w-white);
}

.w-logo {
  font-size: var(--w-font-size-xl);
  font-weight: var(--w-font-weight-bold);
  color: var(--w-white);
  text-decoration: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.w-footer {
  background: var(--w-gray-800);
  color: var(--w-white);
  padding: var(--w-space-5xl) var(--w-space-4xl) var(--w-space-3xl);
}

.w-footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--w-space-4xl);
  max-width: var(--w-container-max);
  margin: 0 auto;
}

.w-footer__title {
  font-size: var(--w-font-size-md);
  font-weight: var(--w-font-weight-semibold);
  margin-bottom: var(--w-space-lg);
}

.w-footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.w-footer__links li {
  margin-bottom: var(--w-space-sm);
}

.w-footer__links a {
  color: var(--w-gray-400);
  text-decoration: none;
  font-size: var(--w-font-size-base);
  transition: color var(--w-transition-fast);
}

.w-footer__links a:hover {
  color: var(--w-white);
}

.w-footer__bottom {
  max-width: var(--w-container-max);
  margin: var(--w-space-3xl) auto 0;
  padding-top: var(--w-space-2xl);
  border-top: 1px solid var(--w-gray-700);
  text-align: center;
  font-size: var(--w-font-size-sm);
  color: var(--w-gray-500);
}

@media (max-width: 992px) {
  .w-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .w-footer__grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.w-container {
  max-width: var(--w-container-xl);
  margin: 0 auto;
  padding: 0 var(--w-space-xl);
}

.w-container--sm {
  max-width: var(--w-container-sm);
}

.w-container--md {
  max-width: var(--w-container-md);
}

.w-container--lg {
  max-width: var(--w-container-lg);
}

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

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

.w-mb-0 { margin-bottom: 0; }
.w-mb-sm { margin-bottom: var(--w-space-sm); }
.w-mb-md { margin-bottom: var(--w-space-md); }
.w-mb-lg { margin-bottom: var(--w-space-lg); }
.w-mb-xl { margin-bottom: var(--w-space-xl); }
.w-mb-2xl { margin-bottom: var(--w-space-2xl); }
.w-mb-3xl { margin-bottom: var(--w-space-3xl); }

/* ==========================================================================
   Mobile Responsive Base
   ========================================================================== */

@media (max-width: 768px) {
  :root {
    --w-font-size-4xl: 28px;
    --w-font-size-5xl: 32px;
  }

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

  .w-prayer-bar {
    gap: var(--w-space-lg);
    font-size: var(--w-font-size-xs);
    flex-wrap: wrap;
  }

  .w-topbar {
    padding: var(--w-space-md) var(--w-space-lg);
  }

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

  .w-step__label {
    display: none;
  }
}
