/* ==========================================================================
   UI COMPONENTS & SYSTEM ELEMENTS
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal), background-color var(--transition-normal);
  z-index: 1;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--grad-primary);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.65);
  transform: translateY(-2px);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.6s ease;
  z-index: -1;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-light);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-cyan {
  background: var(--grad-cyan);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-cyan:hover {
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.65);
  transform: translateY(-2px);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-normal);
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  color: var(--primary-light);
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.55rem 1.15rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 1.1rem 2.25rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.w-full {
  width: 100%;
}

/* --------------------------------------------------------------------------
   2. Glassmorphism Card System
   -------------------------------------------------------------------------- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-slow), border-color var(--transition-slow), box-shadow var(--transition-slow);
}

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

.glass-card:hover::before {
  opacity: 1;
}

.glass-card-hover:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 25px rgba(99, 102, 241, 0.15);
}

/* --------------------------------------------------------------------------
   3. Status & Live Badges
   -------------------------------------------------------------------------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 1rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-emerald);
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--accent-emerald);
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.6); opacity: 0.9; }
  80%, 100% { transform: scale(2.2); opacity: 0; }
}

/* --------------------------------------------------------------------------
   4. Interactive Terminal Component
   -------------------------------------------------------------------------- */
.terminal-window {
  background: var(--bg-code);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 30px rgba(99, 102, 241, 0.12);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
}

.terminal-header {
  background: rgba(20, 27, 45, 0.9);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-body {
  padding: 1.25rem;
  min-height: 250px;
  max-height: 320px;
  overflow-y: auto;
  color: #cbd5e1;
  line-height: 1.7;
}

.terminal-line {
  margin-bottom: 0.4rem;
  word-break: break-word;
}

.terminal-prompt {
  color: var(--secondary-light);
  margin-right: 0.5rem;
}

.terminal-cmd {
  color: #38bdf8;
}

.terminal-output {
  color: #94a3b8;
  margin-left: 0.5rem;
  font-size: 0.85rem;
}

.terminal-success {
  color: #34d399;
}

.terminal-highlight {
  color: #f472b6;
}

.terminal-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.terminal-input {
  background: transparent;
  border: none;
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  flex: 1;
  outline: none;
}

.terminal-quick-cmds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  background: rgba(13, 17, 26, 0.6);
  border-top: 1px solid var(--border-subtle);
}

.quick-cmd-btn {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-cmd-btn:hover {
  background: var(--primary);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   5. Interactive Budget Calculator Component
   -------------------------------------------------------------------------- */
.calculator-box {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-2xl);
}

.calc-step {
  margin-bottom: var(--space-xl);
}

.calc-step-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.calc-step-num {
  width: 26px;
  height: 26px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.calc-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.calc-option-card {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
}

.calc-option-card:hover {
  border-color: var(--primary-light);
  background: rgba(99, 102, 241, 0.06);
  transform: translateY(-2px);
}

.calc-option-card.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.15);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.calc-option-card .opt-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.calc-option-card .opt-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.calc-option-card .opt-price {
  font-size: 0.85rem;
  color: var(--secondary-light);
  font-weight: 600;
  margin-top: 0.5rem;
}

.addon-check {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid var(--border-medium);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.calc-option-card.active .addon-check {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.calc-summary-side {
  display: flex;
  flex-direction: column;
}

.calc-summary-panel {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.summary-badge {
  display: inline-block;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary-light);
}

.calc-price-display {
  font-size: 3rem;
  font-weight: 800;
  font-family: var(--font-sans);
  color: #ffffff;
  line-height: 1.1;
  margin: 0.5rem 0;
}

[data-theme="light"] .calc-price-display {
  color: var(--text-primary);
}

.calc-delivery-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.calc-breakdown-list {
  list-style: none;
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 180px;
  overflow-y: auto;
}

.calc-breakdown-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: 0.35rem;
}

.calc-cta-group {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.calc-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   6. Modal System
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  max-width: 820px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
  transform: scale(0.95);
  transition: transform var(--transition-bounce);
  padding: var(--space-2xl);
}

.modal-backdrop.active .modal-container {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  transform: rotate(90deg);
}

/* --------------------------------------------------------------------------
   7. Toast Notification System
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.25);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: auto;
  animation: slide-in-toast 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-in-toast {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-success {
  border-color: var(--accent-emerald);
}

.toast-success i {
  color: var(--accent-emerald);
}
