/**
 * @file
 * APB Base CSS - Loaded on both admin and front-end.
 *
 * Common styles and utilities used across the site.
 */

/* Base Variables */
:root {
  --apb-spacing-xs: 4px;
  --apb-spacing-sm: 8px;
  --apb-spacing-md: 16px;
  --apb-spacing-lg: 24px;
  --apb-spacing-xl: 32px;

  --apb-color-primary: #0073aa;
  --apb-color-secondary: #005177;
  --apb-color-success: #46b450;
  --apb-color-warning: #ffb900;
  --apb-color-error: #dc3232;

  --apb-border-radius: 4px;
  --apb-transition: all 0.3s ease;
}

/* Common APB Styles */
.apb-section {
  position: relative;
  width: 100%;
}

.apb-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--apb-spacing-md);
}

/* Grid System */
.apb-grid {
  display: grid;
  gap: var(--apb-spacing-md);
}

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

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

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

/* Responsive Grid */
@media (max-width: 768px) {
  .apb-grid-2,
  .apb-grid-3,
  .apb-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Utility Classes */
.apb-hidden {
  display: none !important;
}

.apb-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.apb-text-left {
  text-align: left;
}

.apb-text-right {
  text-align: right;
}

/* Spacing Utilities */
.apb-mt-0 {
  margin-top: 0;
}
.apb-mt-sm {
  margin-top: var(--apb-spacing-sm);
}
.apb-mt-md {
  margin-top: var(--apb-spacing-md);
}
.apb-mt-lg {
  margin-top: var(--apb-spacing-lg);
}

.apb-mb-0 {
  margin-bottom: 0;
}
.apb-mb-sm {
  margin-bottom: var(--apb-spacing-sm);
}
.apb-mb-md {
  margin-bottom: var(--apb-spacing-md);
}
.apb-mb-lg {
  margin-bottom: var(--apb-spacing-lg);
}

/* Animation Utilities */
.apb-fade-in {
  animation: apbFadeIn 0.3s ease-in;
}

@keyframes apbFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading State */
.apb-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.apb-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--apb-color-primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: apbSpin 0.6s linear infinite;
}

@keyframes apbSpin {
  to {
    transform: rotate(360deg);
  }
}
