/* Nordic Studios Design System v1.0 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Colors - Blue Accent */
  --bg-color: #0B0B0C;
  --sidebar-color: #0D0D0D;
  --card-color: #1E1E1E;
  --card-stroke: #4A4A4A;
  --accent: #3b82f6;
  --accent-dark: #1e3a5f;
  --accent-light: #60a5fa;
  --button-color: #141414;
  
  --text-primary: #FFFFFF;
  --text-accent: #3b82f6;
  --text-accent-light: #60a5fa;
  --text-disabled: #6C6C6C;
  
  /* Shadows */
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 15px rgba(59, 130, 246, 0.3);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Typography */
.typo-display { font-size: 48px; font-weight: 700; letter-spacing: -1px; }
.typo-h1 { font-size: 36px; font-weight: 700; }
.typo-h2 { font-size: 28px; font-weight: 600; }
.typo-h3 { font-size: 22px; font-weight: 600; }
.typo-body { font-size: 16px; font-weight: 400; line-height: 1.5; }
.typo-small { font-size: 14px; font-weight: 400; color: var(--text-disabled); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.btn-primary {
  background-color: var(--button-color);
  color: var(--text-accent);
  border-color: var(--accent);
}
.btn-primary:hover {
  background-color: var(--accent-dark);
  box-shadow: none;
}
.btn-primary:focus-visible {
  background-color: var(--accent);
  color: var(--text-primary);
  border-color: var(--bg-color);
  box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 4px var(--accent);
}
.btn-primary:active {
  background-color: var(--accent-light);
  color: var(--bg-color);
  border-color: var(--accent-light);
  transform: scale(0.95);
  box-shadow: none;
}

.btn-secondary {
  background-color: var(--button-color);
  color: var(--text-primary);
  border: 1px solid var(--card-stroke);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}
.btn-secondary:active {
  transform: scale(0.95);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-primary);
}
.btn-ghost:hover {
  background-color: var(--card-color);
}
.btn-ghost:active {
  transform: scale(0.95);
}

.btn-disabled {
  background-color: var(--card-color);
  color: var(--text-disabled);
  cursor: not-allowed;
  border: 1px solid var(--card-stroke);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* Input */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 300px;
}
.input-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.input-field {
  background-color: var(--button-color);
  border: 1px solid var(--card-stroke);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  transition: var(--transition);
}
.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  outline: none;
}
.input-field::placeholder {
  color: var(--text-disabled);
}
.input-error {
  border-color: #ff4d4d;
}
.error-text {
  color: #ff4d4d;
  font-size: 12px;
}

/* Badge & Chip */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-accent { background-color: rgba(59, 130, 246, 0.2); color: var(--accent-light); border: 1px solid var(--accent); }
.badge-neutral { background-color: var(--card-color); color: var(--text-primary); border: 1px solid var(--card-stroke); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background-color: var(--card-color);
  border: 1px solid var(--card-stroke);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.chip:hover, .chip.active {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: var(--accent);
  color: var(--accent-light);
}

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

.loader-dots {
  display: flex;
  gap: 6px;
}
.loader-dots span {
  width: 10px;
  height: 10px;
  background-color: var(--accent);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}
.loader-dots span:nth-child(1) { animation-delay: -0.32s; }
.loader-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce { 
  0%, 80%, 100% { transform: scale(0); } 
  40% { transform: scale(1); } 
}

/* Progress Bar */
.progress-container {
  width: 300px;
  height: 8px;
  background-color: var(--card-color);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--card-stroke);
}
.progress-fill {
  height: 100%;
  background-color: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
  width: 65%;
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* Toggle */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--card-color);
  border: 1px solid var(--card-stroke);
  transition: .4s;
  border-radius: 34px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-disabled);
  transition: .4s;
  border-radius: 50%;
}
input:checked + .toggle-slider {
  background-color: var(--accent);
  border-color: var(--accent);
}
input:checked + .toggle-slider:before {
  transform: translateX(24px);
  background-color: var(--bg-color);
}

/* Radio & Checkbox */
.radio-container, .checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 15px;
  user-select: none;
}
.radio-container input, .checkbox-container input {
  display: none;
}
.checkmark {
  width: 20px;
  height: 20px;
  background-color: var(--card-color);
  border: 1px solid var(--card-stroke);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.radio-container .checkmark {
  border-radius: 50%;
}
.checkmark::after {
  content: "";
  display: none;
}
.radio-container input:checked ~ .checkmark {
  border-color: var(--accent);
}
.radio-container input:checked ~ .checkmark::after {
  display: block;
  width: 10px;
  height: 10px;
  background-color: var(--accent);
  border-radius: 50%;
}
.checkbox-container input:checked ~ .checkmark {
  background-color: var(--accent);
  border-color: var(--accent);
}
.checkbox-container input:checked ~ .checkmark::after {
  display: block;
  width: 5px;
  height: 10px;
  border: solid var(--bg-color);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

/* Card */
.card {
  background-color: var(--card-color);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 300px;
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-dark);
}

/* Alert */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 400px;
}
.alert-success { background-color: rgba(59, 130, 246, 0.1); border: 1px solid var(--accent); color: var(--accent-light); }
.alert-error { background-color: rgba(255, 77, 77, 0.1); border: 1px solid #ff4d4d; color: #ff4d4d; }
.alert-warning { background-color: rgba(255, 170, 0, 0.1); border: 1px solid #ffaa00; color: #ffaa00; }
.alert-info { background-color: rgba(51, 153, 255, 0.1); border: 1px solid #3399ff; color: #3399ff; }

/* Modal / Pop-up */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background-color: var(--card-color);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius-lg);
  padding: 30px;
  width: 400px;
  max-width: 90%;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

/* List */
.list-group {
  background-color: var(--card-color);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius-lg);
  width: 300px;
  overflow: hidden;
}
.list-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-stroke);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  cursor: pointer;
}
.list-item:last-child {
  border-bottom: none;
}
.list-item:hover {
  background-color: var(--button-color);
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background-color: var(--card-color);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius-md);
  min-width: 200px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: var(--transition);
  z-index: 10;
}
.dropdown.active .dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.dropdown-item {
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  transition: var(--transition);
}
.dropdown-item:hover {
  background-color: var(--button-color);
  color: var(--accent-light);
}

/* Tabs */
.tabs-container {
  border-bottom: 1px solid var(--card-stroke);
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.tab-btn {
  background: none;
  border: none;
  color: var(--text-disabled);
  font-size: 16px;
  font-weight: 500;
  padding: 12px 4px;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}
.tab-btn:hover {
  color: var(--text-primary);
}
.tab-btn.active {
  color: var(--accent-light);
}
.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent);
  border-radius: 2px 2px 0 0;
}
.tab-content-panel {
  display: none;
  color: var(--text-primary);
}
.tab-content-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Pagination */
.pagination {
  display: flex;
  gap: 8px;
}
.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background-color: var(--card-color);
  border: 1px solid var(--card-stroke);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}
.page-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}
.page-btn.active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--bg-color);
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 600px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
}
.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--card-color);
  border: 2px solid var(--card-stroke);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}
.step.active .step-circle {
  border-color: var(--accent);
  background-color: rgba(59, 130, 246, 0.2);
  color: var(--accent-light);
}
.step.completed .step-circle {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--bg-color);
}
.step-label {
  font-size: 12px;
  color: var(--text-disabled);
  font-weight: 500;
}
.step.active .step-label { color: var(--text-primary); }
.stepper-line {
  flex: 1;
  height: 2px;
  background-color: var(--card-stroke);
  margin-top: -20px;
  z-index: 1;
}
.stepper-line.active { background-color: var(--accent); }

/* Animations */
.anim-bounce { animation: bounceElem 2s infinite; }
.anim-pulse { animation: pulseElem 2s infinite; }
.anim-shake:hover { animation: shakeElem 0.5s; }

@keyframes bounceElem { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
@keyframes pulseElem { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); } 70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(59, 130, 246, 0); } 100% { transform: scale(1); } }
@keyframes shakeElem { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-5px); } }

/* Action Sheet */
.action-sheet-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0,0,0,0.6);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.action-sheet-overlay.active { opacity: 1; pointer-events: auto; }
.action-sheet {
  position: fixed;
  bottom: -100%; left: 0; right: 0;
  background-color: var(--card-color);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: 24px;
  transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
  border-top: 1px solid var(--card-stroke);
}
.action-sheet-overlay.active .action-sheet { bottom: 0; }
.action-sheet-btn {
  width: 100%;
  padding: 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--card-stroke);
  color: var(--text-primary);
  font-size: 16px;
  text-align: center;
  cursor: pointer;
}
.action-sheet-btn:last-child { border-bottom: none; }
.action-sheet-btn.danger { color: #ff4d4d; }

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