/* ==========================================================================
   RakMind Labs - UI Components Styles
   ========================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-dark-primary);
  border-color: var(--bg-dark-border);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(148, 163, 184, 0.3);
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--bg-dark-border);
  color: var(--text-dark-secondary);
}

.btn-outline:hover {
  border-color: #38bdf8;
  color: #38bdf8;
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.725rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-dsa {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-ai {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

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

.badge-difficulty {
  background: rgba(15, 23, 42, 0.6);
  color: #94a3b8;
  border: 1px solid var(--bg-dark-border);
}

.badge-featured {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(249, 115, 22, 0.2));
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.4);
}

/* Filter Bar & Controls */
.filter-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--bg-dark-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tab-btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dark-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.search-box {
  position: relative;
  min-width: 260px;
}

.search-input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.25rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--bg-dark-border);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dark-muted);
  font-size: 0.85rem;
}

/* Simulation Grid & Cards */
.simulations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.75rem;
  margin-bottom: 3.5rem;
}

.sim-card {
  position: relative;
  background: #0f172a;
  border: 1px solid var(--bg-dark-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.sim-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px -5px rgba(56, 189, 248, 0.15);
}

.sim-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(800px circle at var(--mouse-x, 100px) var(--mouse-y, 100px), rgba(56, 189, 248, 0.06), transparent 40%);
  pointer-events: none;
}

.sim-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.sim-icon-wrapper {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sim-icon-dsa { color: #60a5fa; background: rgba(37, 99, 235, 0.12); }
.sim-icon-ai { color: #c084fc; background: rgba(168, 85, 247, 0.12); }
.sim-icon-math { color: #fbbf24; background: rgba(245, 158, 11, 0.12); }

.sim-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.sim-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.sim-card-desc {
  font-size: 0.88rem;
  color: var(--text-dark-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
}

.sim-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
}

.sim-tag {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-dark-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sim-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  gap: 0.75rem;
}

.sim-complexity {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: #38bdf8;
}

.sim-actions {
  display: flex;
  gap: 0.5rem;
}

/* Preview Modal */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.preview-modal.active {
  display: flex;
}

.preview-modal-dialog {
  width: 95%;
  max-width: 1200px;
  height: 85vh;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
}

.preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #090d16;
  border-bottom: 1px solid var(--bg-dark-border);
}

.preview-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.preview-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.preview-modal-body {
  flex: 1;
  background: #000000;
  position: relative;
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
}
