/* Advanced UI/UX Enhancements for e-Vents
   Legacy helpers — aligned with ev-design-system palette (cyan accent). */

:root {
  --bg-primary: var(--ev-surface, #ffffff);
  --bg-secondary: var(--ev-bg, #f8fafc);
  --text-primary: var(--ev-text, #0f172a);
  --text-secondary: var(--ev-text-muted, #64748b);
  --border-color: var(--ev-border, #e2e8f0);
  --accent-color: var(--ev-accent, #06b6d4);
  --success-color: var(--ev-success, #10b981);
  --warning-color: var(--ev-warning, #f59e0b);
  --error-color: var(--ev-danger, #ef4444);
}

[data-theme="dark"] {
  --bg-primary: var(--ev-surface);
  --bg-secondary: var(--ev-bg);
  --text-primary: var(--ev-text);
  --text-secondary: var(--ev-text-muted);
  --border-color: var(--ev-border);
}

/* Do not override ev-app body styles from the design system */
body:not(.ev-app) {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--accent-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 4. Button baseline (design-system owns visual language; keep selector for compatibility) */
.btn-primary {
  background: var(--ev-accent, #06b6d4);
  color: var(--ev-navy, #0f172a);
  padding: 0.6rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--ev-radius-md, 12px);
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: background var(--ev-transition-fast, 150ms ease), box-shadow var(--ev-transition-fast, 150ms ease);
}

.btn-primary::before {
  content: none;
}

.btn-primary:hover::before {
  content: none;
}

.btn-primary:hover {
  background: var(--ev-accent-hover, #0891b2);
  box-shadow: var(--ev-shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.08));
}

/* 5. Legacy event card — defer motion to design-system cards */
.event-card {
  background: var(--ev-surface, var(--bg-primary, #fff));
  border-radius: var(--ev-radius-lg, 16px);
  box-shadow: var(--ev-shadow-md, 0 4px 6px rgba(0,0,0,0.1));
  transition: box-shadow var(--ev-transition-normal, 200ms ease), transform var(--ev-transition-fast, 150ms ease);
  position: relative;
  overflow: hidden;
}

.event-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--ev-accent, #06b6d4);
  transform: scaleX(0);
  transition: transform var(--ev-transition-normal, 200ms ease);
}

.event-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ev-shadow-hover, 0 8px 24px rgba(15, 23, 42, 0.1));
}

.event-card:hover::before {
  transform: scaleX(1);
}

.modal-content {
  background: var(--ev-surface, var(--bg-primary, #fff));
  border-radius: var(--ev-radius-lg, 16px);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  transform: none;
  transition: opacity var(--ev-transition-normal, 200ms ease);
}

/* 7. Enhanced Navigation */
.nav-item {
  position: relative;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: all 0.3s ease;
}

.nav-item:hover::after,
.nav-item.active::after {
  width: 80%;
  left: 10%;
}

/* 8. Advanced Notification System */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  z-index: 1001;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  background: var(--success-color);
}

.notification.error {
  background: var(--error-color);
}

.notification.warning {
  background: var(--warning-color);
}

/* 11. Responsive Design Enhancements */
@media (max-width: 768px) {
  .modal-content {
    margin: 20px;
    padding: 1.5rem;
  }
  
  .event-card {
    margin-bottom: 16px;
  }
  
  .btn-primary {
    width: 100%;
    margin-bottom: 8px;
  }
}

/* 12. Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-only {
    display: block !important;
  }
  
  .event-card,
  .modal-content {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
}

/* 13. Accessibility Enhancements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-secondary: #000000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
