/**
 * Reusable Component Library
 * Professional, consistent components for the Blueva design system
 */

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: 1;
  text-decoration: none;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Button variants */
.btn--primary {
  background: var(--gradient-brand);
  color: white;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.btn--secondary {
  background: var(--theme-bg-tertiary);
  color: var(--theme-text-primary);
  border-color: var(--theme-border-subtle);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--theme-bg-secondary);
  border-color: var(--theme-border-medium);
}

.btn--outline {
  background: transparent;
  color: var(--theme-text-primary);
  border-color: var(--theme-border-strong);
}

.btn--outline:hover:not(:disabled) {
  background: var(--theme-bg-tertiary);
  border-color: var(--theme-accent-primary);
  color: var(--theme-accent-primary);
}

.btn--ghost {
  background: transparent;
  color: var(--theme-text-secondary);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--theme-bg-tertiary);
  color: var(--theme-text-primary);
}

.btn--success {
  background: var(--gradient-success);
  color: white;
}

.btn--warning {
  background: var(--gradient-warning);
  color: white;
}

.btn--danger {
  background: linear-gradient(135deg, var(--color-error) 0%, var(--color-error-dark) 100%);
  color: white;
}

/* Button sizes */
.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

.btn--full {
  width: 100%;
}

/* ========================================
   CARDS
   ======================================== */

.card {
  background: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border-subtle);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--theme-border-medium);
  box-shadow: var(--theme-shadow-lg);
}

.card__header {
  margin-bottom: var(--space-4);
}

.card__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--theme-text-primary);
  margin-bottom: var(--space-2);
}

.card__subtitle {
  font-size: var(--text-sm);
  color: var(--theme-text-tertiary);
}

.card__body {
  color: var(--theme-text-secondary);
  line-height: var(--leading-relaxed);
}

.card__footer {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--theme-border-subtle);
}

/* Card variants */
.card--elevated {
  background: var(--theme-bg-elevated);
  box-shadow: var(--theme-shadow-md);
}

.card--interactive {
  cursor: pointer;
}

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

.card--featured {
  border-color: rgba(251, 191, 36, 0.4);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.7) 100%);
}

.card--featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.card--featured:hover::before {
  opacity: 1;
}

/* ========================================
   BADGES
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  line-height: 1;
}

.badge--primary {
  background: rgba(6, 182, 212, 0.15);
  color: var(--color-brand-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge--success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge--warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge--error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge--neutral {
  background: var(--theme-bg-tertiary);
  color: var(--theme-text-secondary);
  border: 1px solid var(--theme-border-subtle);
}

.badge--featured {
  background: var(--gradient-warning);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.badge--free {
  background: var(--gradient-success);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* ========================================
   INPUTS & FORMS
   ======================================== */

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--theme-text-primary);
  background: var(--theme-bg-tertiary);
  border: 1px solid var(--theme-border-subtle);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.input:hover {
  border-color: var(--theme-border-medium);
}

.input:focus {
  outline: none;
  border-color: var(--theme-accent-primary);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

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

.textarea {
  min-height: 120px;
  resize: vertical;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306b6d4' stroke-width='2'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 20px;
  padding-right: var(--space-10);
}

/* ========================================
   SECTION CONTAINERS
   ======================================== */

.section {
  padding: var(--space-20) 0;
}

.section--sm {
  padding: var(--space-12) 0;
}

.section--lg {
  padding: var(--space-32) 0;
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section__title {
  font-size: var(--text-5xl);
  font-weight: var(--font-extrabold);
  margin-bottom: var(--space-4);
}

.section__subtitle {
  font-size: var(--text-xl);
  color: var(--theme-text-secondary);
  max-width: 42rem;
  margin: 0 auto;
}

/* ========================================
   GRID LAYOUTS
   ======================================== */

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

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

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

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

/* ========================================
   VIDEO CONTAINER
   ======================================== */

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  border-radius: var(--radius-2xl);
  background: var(--theme-bg-secondary);
}

.video-container iframe,
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ========================================
   DIVIDER
   ======================================== */

.divider {
  height: 1px;
  background: var(--theme-border-subtle);
  margin: var(--space-8) 0;
}

.divider--gradient {
  background: linear-gradient(90deg, transparent, var(--theme-border-medium), transparent);
}

/* ========================================
   LOADING SPINNER
   ======================================== */

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--theme-border-subtle);
  border-top-color: var(--theme-accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ========================================
   TOOLTIP
   ======================================== */

.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip__content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: var(--space-2) var(--space-3);
  background: var(--theme-bg-elevated);
  color: var(--theme-text-primary);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  box-shadow: var(--theme-shadow-lg);
  border: 1px solid var(--theme-border-subtle);
  z-index: var(--z-tooltip);
}

.tooltip:hover .tooltip__content {
  opacity: 1;
}

/* ========================================
   GLASSMORPHISM EFFECTS
   ======================================== */

.glass {
  background: var(--theme-glass-bg);
  backdrop-filter: blur(var(--theme-glass-blur));
  -webkit-backdrop-filter: blur(var(--theme-glass-blur));
  border: 1px solid var(--theme-glass-border);
}

.glass--strong {
  backdrop-filter: blur(var(--blur-xl));
  -webkit-backdrop-filter: blur(var(--blur-xl));
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  background: var(--theme-bg-secondary);
  border-top: 1px solid var(--theme-border-subtle);
  padding: var(--space-20) 0 var(--space-8);
}

.footer__content {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-16);
}

.footer__brand {
  max-width: 400px;
}

.footer__logo {
  width: 80px;
  height: auto;
  margin-bottom: var(--space-4);
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.footer__logo:hover {
  opacity: 1;
}

.footer__description {
  font-size: var(--text-base);
  color: var(--theme-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.footer__copyright {
  font-size: var(--text-sm);
  color: var(--theme-text-primary);
  font-weight: var(--font-medium);
  margin-bottom: var(--space-2);
}

.footer__disclaimer {
  font-size: var(--text-xs);
  color: var(--theme-text-tertiary);
  line-height: var(--leading-relaxed);
}

.footer__links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-8);
}

.footer__column-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--theme-text-primary);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer__link {
  display: block;
  font-size: var(--text-sm);
  color: var(--theme-text-secondary);
  text-decoration: none;
  margin-bottom: var(--space-2);
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: var(--theme-accent-primary);
}

/* Footer responsive styles */
@media (max-width: 768px) {
  .footer__content {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  
  .footer__links {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .footer__links {
    grid-template-columns: 1fr;
  }
}
