/* ============================================
   CREONIX COMPONENTS V2 - REUSABLE UI COMPONENTS
   ============================================ */

/* ============================================
   1. BADGES & PILLS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-full);
  font-size: 0.813rem;
  font-weight: 600;
  line-height: 1;
}

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

.badge-secondary {
  background: rgba(155, 135, 245, 0.15);
  border: 1px solid rgba(155, 135, 245, 0.3);
  color: var(--color-primary);
}

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

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

/* ============================================
   2. CARDS
   ============================================ */
.card {
  background: linear-gradient(145deg, rgba(31, 41, 55, 0.5), rgba(17, 24, 39, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition-base);
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-glow);
}

.card-glass {
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-glow {
  box-shadow: 0 0 30px rgba(155, 135, 245, 0.2);
}

.card-glow:hover {
  box-shadow: 0 0 40px rgba(155, 135, 245, 0.35);
}

/* ============================================
   3. TABS (Generic)
   ============================================ */
.tabs-container {
  display: flex;
  gap: 0.5rem;
  background: rgba(17, 24, 39, 0.5);
  padding: 0.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-button {
  flex: 1;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: 0.938rem;
  cursor: pointer;
  transition: all var(--transition-base);
}

.tab-button:hover {
  background: rgba(31, 41, 55, 0.6);
  color: var(--color-text-primary);
}

.tab-button.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(155, 135, 245, 0.3);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeInUp 0.4s ease-out;
}

/* ============================================
   4. MODALS & OVERLAYS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: 1rem;
}

.modal-container {
  position: relative;
  width: 100%;
  max-width: 42rem;
  max-height: 90vh;
  background: linear-gradient(145deg, rgba(31, 41, 55, 0.95), rgba(17, 24, 39, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* ============================================
   5. TOOLTIPS
   ============================================ */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-content {
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1rem;
  background-color: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: var(--z-tooltip);
}

.tooltip:hover .tooltip-content {
  opacity: 1;
  visibility: visible;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(17, 24, 39, 0.95);
}

/* ============================================
   6. LOADING STATES
   ============================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(31, 41, 55, 0.3) 0%,
    rgba(55, 65, 81, 0.5) 50%,
    rgba(31, 41, 55, 0.3) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(155, 135, 245, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spinner-rotation 0.8s linear infinite;
}

@keyframes spinner-rotation {
  to {
    transform: rotate(360deg);
  }
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-lg {
  width: 60px;
  height: 60px;
  border-width: 4px;
}

/* ============================================
   7. ALERTS & NOTIFICATIONS
   ============================================ */
.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: 0.938rem;
  line-height: 1.5;
}

.alert-info {
  background: rgba(51, 195, 240, 0.1);
  border-color: rgba(51, 195, 240, 0.3);
  color: var(--color-accent);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--color-success);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--color-warning);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--color-error);
}

/* ============================================
   8. FORMS & INPUTS
   ============================================ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary);
  font-weight: 500;
  font-size: 0.938rem;
}

.form-input {
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: rgba(31, 41, 55, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 1rem;
  transition: all var(--transition-base);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(155, 135, 245, 0.2);
}

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

.form-select {
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: rgba(31, 41, 55, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-base);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 3rem;
}

.form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(155, 135, 245, 0.2);
}

.form-textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.875rem 1.25rem;
  background: rgba(31, 41, 55, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 1rem;
  font-family: var(--font-sans);
  resize: vertical;
  transition: all var(--transition-base);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(155, 135, 245, 0.2);
}

/* ============================================
   9. PROGRESS BARS
   ============================================ */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(31, 41, 55, 0.5);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-bar-lg {
  height: 12px;
}

.progress-bar-sm {
  height: 4px;
}

/* ============================================
   10. DIVIDERS
   ============================================ */
.divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 2rem 0;
}

.divider-gradient {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(155, 135, 245, 0.5) 50%,
    transparent
  );
}

.divider-text {
  position: relative;
  text-align: center;
  margin: 2rem 0;
}

.divider-text::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.divider-text span {
  position: relative;
  display: inline-block;
  padding: 0 1rem;
  background: var(--color-bg-primary);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ============================================
   11. ICON WRAPPERS
   ============================================ */
.icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(155, 135, 245, 0.1);
  color: var(--color-primary);
  transition: all var(--transition-base);
}

.icon-wrapper:hover {
  background: rgba(155, 135, 245, 0.2);
  transform: scale(1.1);
}

.icon-wrapper-lg {
  width: 64px;
  height: 64px;
}

.icon-wrapper-sm {
  width: 36px;
  height: 36px;
}

.icon-wrapper-circle {
  border-radius: 50%;
}

/* ============================================
   12. LISTS
   ============================================ */
.list-check {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-check li {
  padding: 0.75rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.list-check li:last-child {
  border-bottom: none;
}

.list-check li::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 0.125rem;
  background: var(--gradient-primary);
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 50%;
}

/* ============================================
   13. STATS & METRICS
   ============================================ */
.stat-card {
  background: linear-gradient(145deg, rgba(31, 41, 55, 0.5), rgba(17, 24, 39, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: all var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-glow);
}

.stat-value {
  font-size: 3rem;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ============================================
   14. TIMELINE
   ============================================ */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--color-primary),
    var(--color-accent)
  );
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.375rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  background: var(--gradient-primary);
  border-radius: 50%;
  border: 2px solid var(--color-bg-primary);
  box-shadow: 0 0 0 4px rgba(155, 135, 245, 0.2);
}

.timeline-item:last-child {
  margin-bottom: 0;
}

/* ============================================
   15. RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 768px) {
  .modal-container {
    max-width: calc(100vw - 2rem);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1.25rem;
  }

  .tabs-container {
    flex-direction: column;
  }

  .tab-button {
    padding: 0.875rem 1rem;
  }
}

/* ============================================
   16. GLASSMORPHISM EFFECTS
   ============================================ */
.glass {
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-strong {
  background: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glass-light {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ============================================
   17. HOVER EFFECTS
   ============================================ */
.hover-lift {
  transition: transform var(--transition-base);
}

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

.hover-scale {
  transition: transform var(--transition-base);
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(155, 135, 245, 0.4);
}

/* ============================================
   18. TEXT UTILITIES
   ============================================ */
.text-balance {
  text-wrap: balance;
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-gradient-primary {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

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

/* ============================================
   19. BORDER UTILITIES
   ============================================ */
.border-gradient {
  border: 1px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.border-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-primary);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ============================================
   20. ANIMATIONS
   ============================================ */
@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-slide-in-left {
  animation: slideInFromLeft 0.6s ease-out;
}

.animate-slide-in-right {
  animation: slideInFromRight 0.6s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.4s ease-out;
}

/* ============================================
   DEMO CONTENT MODAL (Lightbox)
   ============================================ */
.demo-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.demo-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
}

.demo-modal-container {
  position: relative;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.demo-modal-content {
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Close Button */
.demo-modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10001;
}

.demo-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Navigation Arrows */
.demo-modal-prev,
.demo-modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10001;
}

.demo-modal-prev {
  left: 20px;
}

.demo-modal-next {
  right: 20px;
}

.demo-modal-prev:hover,
.demo-modal-next:hover {
  background: rgba(155, 135, 245, 0.3);
  border-color: rgba(155, 135, 245, 0.5);
  transform: translateY(-50%) scale(1.1);
}

/* Modal Image */
.demo-modal-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Modal Video */
.demo-modal-video {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Modal Audio Player */
.modal-audio-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 3rem;
  background: linear-gradient(145deg, rgba(31, 41, 55, 0.8), rgba(17, 24, 39, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  min-width: 400px;
}

.audio-player-icon {
  color: var(--color-primary);
  opacity: 0.6;
}

.audio-player-controls {
  width: 100%;
  max-width: 500px;
  outline: none;
}

.audio-player-controls::-webkit-media-controls-panel {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
}

/* Metadata Info */
.demo-modal-info {
  margin-top: 1.5rem;
  text-align: center;
  max-width: 600px;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.5rem;
}

.modal-meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .demo-modal-prev,
  .demo-modal-next {
    width: 40px;
    height: 40px;
  }

  .demo-modal-prev {
    left: 10px;
  }

  .demo-modal-next {
    right: 10px;
  }

  .modal-audio-player {
    min-width: 300px;
    padding: 2rem;
  }

  .demo-modal-close {
    top: -40px;
    width: 36px;
    height: 36px;
  }
}

