/**
 * KeyGrip Design System
 * Inspired by shadcn/ui design principles
 * 
 * This is the main entry point that imports all design system components
 */

/* ============================================
   1. Design Tokens (CSS Variables)
   ============================================ */
@import url('tokens.css');

/* ============================================
   2. Base Styles (Reset & Typography)
   ============================================ */
@import url('base.css');

/* ============================================
   3. Components
   ============================================ */
@import url('components/buttons.css');
@import url('components/forms.css');
@import url('components/cards.css');
@import url('components/tables.css');
@import url('components/navigation.css');
@import url('components/alerts.css');

/* ============================================
   4. Utility Classes
   ============================================ */
@import url('utilities.css');

/* ============================================
   5. Custom Components (Project-specific)
   ============================================ */

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid hsl(var(--muted));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

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

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

/* Progress Bar */
.progress {
  width: 100%;
  height: 0.5rem;
  background-color: hsl(var(--secondary));
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: hsl(var(--primary));
  border-radius: var(--radius-full);
  transition: width var(--duration-300) var(--ease-in-out);
}

.progress-bar-animated {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
  animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
  from {
    background-position: 1rem 0;
  }
  to {
    background-position: 0 0;
  }
}

/* Modal/Dialog */
.modal {
  display: none;
  position: fixed;
  z-index: var(--z-modal);
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: hsl(var(--card));
  margin: 5% auto;
  padding: 0;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  box-shadow: var(--shadow-2xl);
  animation: modal-slide-in var(--duration-300) var(--ease-out);
}

@keyframes modal-slide-in {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: var(--text-2xl);
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: all var(--duration-200) var(--ease-in-out);
}

.modal-close:hover {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  padding: var(--space-6);
  border-top: 1px solid hsl(var(--border));
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Hero Section */
.hero {
  padding: var(--space-16) 0;
  text-align: center;
  background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--primary) / 0.8) 100%);
  color: hsl(var(--primary-foreground));
  border-radius: var(--radius-lg);
}

.hero-title {
  font-size: var(--text-5xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-4);
}

.hero-subtitle {
  font-size: var(--text-xl);
  opacity: 0.9;
  margin-bottom: var(--space-8);
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: hsl(var(--popover));
  min-width: 160px;
  box-shadow: var(--shadow-lg);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  z-index: var(--z-dropdown);
  margin-top: var(--space-1);
}

.dropdown-content.show {
  display: block;
}

.dropdown-item {
  color: hsl(var(--foreground));
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  display: block;
  font-size: var(--text-sm);
  transition: background-color var(--duration-200) var(--ease-in-out);
}

.dropdown-item:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.dropdown-item:first-child {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* File Upload Area */
.upload-area {
  border: 2px dashed hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: var(--space-12);
  text-align: center;
  background-color: hsl(var(--muted) / 0.3);
  transition: all var(--duration-200) var(--ease-in-out);
  cursor: pointer;
}

.upload-area:hover {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--muted) / 0.5);
}

.upload-area.dragover {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary) / 0.05);
}

.upload-icon {
  font-size: var(--text-4xl);
  color: hsl(var(--muted-foreground));
  margin-bottom: var(--space-4);
}

.upload-text {
  font-size: var(--text-base);
  color: hsl(var(--foreground));
  margin-bottom: var(--space-2);
}

.upload-hint {
  font-size: var(--text-sm);
  color: hsl(var(--muted-foreground));
}