/* ============================================
   COMPONENTS — Buttons, Cards, Badges, Modals
   ============================================ */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-purple-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 24px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  font-family: var(--font);
  min-height: 44px;
  line-height: 1;
}

.btn:hover {
  transform: scale(1.03);
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  background: #3a2a3d;
  color: var(--text-secondary);
  cursor: not-allowed;
  transform: none;
}

.btn-accent {
  background: var(--accent-gradient);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--accent-purple);
  color: var(--accent-purple);
}

.btn-outline:hover {
  background: rgba(160, 132, 238, 0.1);
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.9em;
  min-height: 36px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 15px 30px;
  font-size: 1.1em;
  border-radius: 25px;
  box-shadow: 0 4px 20px rgba(160, 132, 238, 0.3);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: 18px;
  border: 2px solid #8888a0;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}

.card:hover {
  border-color: var(--accent-purple);
}

.card-body {
  padding: 16px;
}

.card-glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8em;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  line-height: 1;
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-purple {
  background: rgba(160, 132, 238, 0.15);
  color: var(--accent-purple);
}

.badge-success {
  background: rgba(76, 175, 80, 0.15);
  color: var(--success);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 22px 22px;
  position: relative;
  animation: slideUp 0.3s ease;
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 12px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.7em;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.modal-title {
  font-size: 1.15em;
  font-weight: bold;
  color: #fff;
  margin-bottom: 8px;
  text-align: center;
}

.modal-desc {
  color: var(--text-muted);
  font-size: 1em;
  margin-bottom: 18px;
  text-align: center;
}

/* Form Inputs */
.input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1em;
  padding: 12px 16px;
  font-family: var(--font);
  transition: border-color var(--transition);
}

.input:focus {
  border-color: var(--accent-purple);
  outline: none;
}

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

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

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a97bb7' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-purple-gradient);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Currency Panel */
.currency-panel {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  padding-right: 50px;
  min-height: 24px;
}

.currency-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1;
}

.currency-icon {
  color: var(--accent-purple);
  font-size: 1.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.currency-value {
  color: #fff;
  font-weight: bold;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.add-currency-btn {
  background: var(--accent-purple-gradient);
  color: #fff;
  border: none;
  border-radius: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: transform var(--transition);
  box-shadow: 0 2px 8px rgba(160, 132, 238, 0.3);
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.add-currency-btn:active {
  transform: translateY(-50%) scale(0.95);
}

/* Daily Bonus Button */
.daily-bonus-btn {
  background: none;
  border: none;
  font-size: 1.8em;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: transform var(--transition);
}

.daily-bonus-btn:active {
  transform: scale(0.9);
}

/* Toast */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 90vw;
}

.toast {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px 20px;
  color: var(--text);
  font-size: 0.95em;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
  pointer-events: auto;
  text-align: center;
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-error {
  border-left: 3px solid var(--danger);
}

.toast-info {
  border-left: 3px solid var(--accent-purple);
}

.toast-exit {
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  color: #fff;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(160, 132, 238, 0.3);
  border-top: 4px solid var(--accent-purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.loading-title {
  font-size: 1.5em;
  font-weight: bold;
  margin-bottom: 10px;
}

.loading-subtitle {
  font-size: 1em;
  color: var(--text-muted);
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9em;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  min-height: 44px;
}

.tab.active {
  background: var(--accent-purple);
  color: #fff;
}

/* Divider */
.divider {
  width: 100%;
  height: 1px;
  background: rgba(160, 132, 238, 0.15);
  border: none;
  margin: 16px 0;
}
