/* src/shared/styles/common.css */

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior-y: auto;
  touch-action: pan-y;
}

/* Mobile: allow pull-to-refresh */
@media (max-width: 768px) {
  body {
    height: 100vh !important;
  }
  
  .main-scroll-container .simplebar-content-wrapper {
    -webkit-overflow-scrolling: touch !important;
  }
}

/* Allow scrolling in our containers */
.page-content {
  overflow: auto;
}

#landing-container {
  overflow: auto;
}

/* Global scrollbar removal */
* {
  -ms-overflow-style: none !important;
  /* IE and Edge */
  scrollbar-width: none !important;
  /* Firefox */
}

*::-webkit-scrollbar {
  display: none !important;
  /* Chrome, Safari and Opera */
}

/* =====================
   Mobile/Desktop Device Detection
   ===================== */
/* Hide mobile-only elements on desktop by default */
.desktop-device .mobile-only,
.desktop-device .mobile-feature-grid {
  display: none !important;
}

/* Hide desktop-only elements on mobile by default */
.mobile-device .desktop-only {
  display: none !important;
}

/* =====================
   Common Button Base Styles
   ===================== */
.button-base {
  padding: 8px 16px;
  font-size: var(--font-size-xs);
  border-radius: 5px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.button-glow {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-speed);
}

.button-glow:hover {
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
}

.btn-cancel {
  box-shadow: none !important;
  background-color: transparent;
  color: var(--status-suspended);
  border: 1px solid var(--status-suspended);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius);
  font-size: var(--font-size-xs);
  transition: all var(--transition-speed);
}

/* =====================
   Common Table Styles
   ===================== */
table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-dark);
  transition: var(--theme-transition);
}

th {
  background-color: var(--surface-dark);
  color: var(--text-dark);
}

body.light-theme th,
body.light-theme td {
  border-bottom-color: var(--border-light);
}

body.light-theme th {
  background-color: var(--surface-light);
  color: var(--text-light);
}

/* =====================
   Common Container Styles
   ===================== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* =====================
   Theme Toggle & Navigation
   ===================== */
.theme-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: var(--z-overlay);
  display: flex;
  gap: 10px;
}

.admin-quick-actions {
  position: fixed;
  top: 70px;
  left: 20px;
  z-index: var(--z-overlay);
  display: flex;
}

.admin-quick-actions .nav-item {
  width: 237.22px;
  padding: 8px 16px;
  font-size: var(--font-size-xs);
  border-radius: var(--border-radius);
  cursor: pointer;
  border: 1px solid var(--border-dark);
  background-color: var(--surface-dark);
  color: var(--text-dark);
  transition: var(--theme-transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

body.light-theme .admin-quick-actions .nav-item {
  background-color: var(--surface-light);
  color: var(--text-light);
  border-color: var(--border-light);
}

.admin-quick-actions .nav-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-color: var(--gold-accent);
}

.theme-toggle-btn,
.back-button {
  padding: 8px 16px;
  font-size: var(--font-size-xs);
  border-radius: var(--border-radius);
  cursor: pointer;
  border: 1px solid var(--border-dark);
  background-color: var(--surface-dark);
  color: var(--text-dark);
  transition: var(--theme-transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

body.light-theme .theme-toggle-btn,
body.light-theme .back-button {
  background-color: var(--surface-light);
  color: var(--text-light);
  border-color: var(--border-light);
}

.theme-toggle-btn:hover,
.back-button:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-color: var(--gold-accent);
}

/* =====================
   Navigation Buttons
   ===================== */
.nav-btn {
  padding: 8px 16px;
  font-size: var(--font-size-xs);
  border-radius: var(--border-radius);
  cursor: pointer;
  border: 1px solid var(--border-dark);
  background-color: var(--surface-dark);
  color: var(--text-dark);
  transition: all var(--transition-speed);
  display: flex;
  align-items: center;
  gap: 8px;
}

body.light-theme .nav-btn {
  background-color: var(--surface-light);
  color: var(--text-light);
  border-color: var(--border-light);
}

.nav-btn:hover,
.theme-toggle-btn:hover {
  border-color: var(--gold-accent);
  color: var(--gold-accent);
}

.nav-btn i {
  font-size: var(--font-size-sm);
}

/* Layout Patterns */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

/* Card Patterns */
.card-base {
  background-color: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--border-radius);
  padding: var(--card-padding);
  transition: all var(--transition-speed);
}

.card-hover {
  transition: all var(--transition-speed);
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-dark);
}

/* Button Patterns */
.btn-base {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-xs);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-speed);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.btn-gold {
  background: transparent;
  border: 1px solid var(--gold-accent);
  color: var(--gold-accent);
}

.btn-gold:hover {
  background: var(--gold-accent);
  color: var(--color-black);
}

/* ======================
   4. Status & Badge Patterns
   ====================== */
/* Status Indicators */
.status-indicator {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-pill);
  font-size: var(--font-size-xs);
}

.status-active {
  background-color: rgba(46, 204, 113, 0.2);
  color: var(--status-active);
}

.status-warning {
  background-color: rgba(241, 196, 15, 0.2);
  color: var(--status-warning);
}

.status-suspended {
  background-color: rgba(231, 76, 60, 0.2);
  color: var(--status-suspended);
}

.status-archived {
  background-color: rgba(149, 165, 166, 0.2);
  color: var(--status-archived);
}

.status-cancelled {
  background-color: rgba(231, 76, 60, 0.2);
  color: var(--status-cancelled);
}

.status-trial {
  background-color: rgba(52, 152, 219, 0.2);
  color: var(--status-trial);
}

/* Status Badges */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius-pill);
  font-size: var(--font-size-xs);
  display: inline-block;
}

.status-badge.successful {
  background-color: rgba(46, 204, 113, 0.2);
  color: var(--status-active);
}

.status-badge.pending {
  background-color: rgba(241, 196, 15, 0.2);
  color: var(--status-warning);
}

.status-badge.failed {
  background-color: rgba(231, 76, 60, 0.2);
  color: var(--status-suspended);
}


/* Modal/Dialog Patterns */
.modal-base {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-bg);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--z-modal);
}

.modal-content-base {
  background: var(--surface-dark);
  border: 2px solid var(--border-dark);
  border-radius: var(--border-radius);
  padding: var(--spacing-xl);
  width: 100%;
  max-width: var(--modal-width);
  position: relative;
  animation: slideUp var(--animation-speed-normal) ease-out;
}

/* Status Indicators */
.status-badge-base {
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius-pill);
  font-size: var(--font-size-xs);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Loading States */
.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-dark);
  border-top-color: var(--gold-accent);
  border-radius: var(--border-radius-circle);
  animation: spin 1s linear infinite;
}

.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
}

/* Grid Layouts */
.grid-base {
  display: grid;
  gap: var(--spacing-md);
}

.grid-2-col {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3-col {
  grid-template-columns: repeat(3, 1fr);
}

.grid-auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Service Status Modals */
.command-example {
  background: rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  margin: 16px 0;
}

.command-example code {
  font-family: monospace;
  color: var(--color-gray-e0);
  word-break: break-all;
}

/* Chart Containers */
.chart-container-base {
  background-color: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--border-radius);
  padding: var(--card-padding);
  display: flex;
  flex-direction: column;
  height: 500px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.chart-wrapper {
  flex: 1;
  position: relative;
  width: 100%;
  height: calc(100% - 40px);
}

/* Metric Cards */
.metric-card-base {
  background-color: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--border-radius);
  padding: var(--card-padding);
}

.metric-value {
  font-size: var(--font-size-xl);
  font-weight: 500;
  color: var(--gold-accent);
  margin-bottom: var(--spacing-xs);
}

.metric-label {
  font-size: var(--font-size-xs);
  opacity: 0.8;
}

/* Form Elements */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-input {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid var(--border-dark);
  background: var(--surface-tint);
  color: var(--text-dark);
  border-radius: var(--border-radius);
  font-size: var(--font-size-xs);
  transition: all var(--transition-speed);
}

.form-input:focus {
  outline: none;
  border-color: var(--gold-accent);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* Mic Specs */
.mic-specs {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    display: grid;
    grid-template-columns: auto;
    gap: 0px;
    min-height: 96px;
}

.mic-specs li {
    color: var(--text-dark);
    font-size: var(--font-size-xss);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 24px;
    line-height: 24px;
}

.mic-specs i {
    color: var(--gold-accent);
    font-size: var(--font-size-xss);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
}

/* Empty/Error States */
.empty-state {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-dark);
}

.empty-state i {
  font-size: var(--font-size-xl);
  color: var(--gold-accent);
  margin-bottom: var(--spacing-md);
}

.error-message {
  color: var(--status-suspended);
  font-size: var(--font-size-xs);
  margin: var(--spacing-sm) 0;
  text-align: center;
}

/* Table Styles */
.table-base {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: var(--surface-dark);
}

.table-cell {
  text-align: left;
}

/* Tooltips */
.tooltip-base {
  background-color: var(--surface-dark);
  border: 1px solid var(--gold-accent);
  border-radius: var(--border-radius);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-xs);
  box-shadow: var(--card-shadow-dark);
}

/* Common Animations */
.fade-in {
  animation: fadeIn var(--animation-speed-normal) ease-out;
}

.slide-up {
  animation: slideUp var(--animation-speed-normal) ease-out;
}

.slide-in-left {
  animation: slideInFromLeft var(--animation-speed-normal) ease-out;
}

.slide-in-right {
  animation: slideInFromRight var(--animation-speed-normal) ease-out;
}

/* Theme Specific Overrides */
body.light-theme .card-base {
  background-color: var(--surface-light);
  border-color: var(--border-light);
}

body.light-theme .form-input {
  background: var(--surface-light);
  border-color: var(--border-light);
  color: var(--text-light);
}

body.light-theme .table-header {
  background-color: var(--surface-light);
}

body.light-theme .tooltip-base {
  background-color: var(--surface-light);
}

/* =====================
   Responsive Design
   ===================== */
@media (max-width: 1200px) {
  .feature-row {
    flex-direction: column;
    margin: 60px auto;
    gap: 2rem;
  }

  .feature-row.reverse {
    flex-direction: column;
  }

  .feature-text.left,
  .feature-text.right {
    text-align: center;
    padding: 1rem;
    max-width: 100%;
  }

  .feature-text h2 {
    font-size: 2.4rem;
  }

  .feature-image {
    width: 100%;
    max-width: 100%;
    padding: 1rem;
  }
}

@media (max-width: 1024px) {
  .pricing-cards-container {
    flex-direction: column;
    align-items: center;
  }

  .pricing-card {
    width: 100%;
    max-width: 500px;
  }

  .theme-toggle {
    top: 10px;
    right: 10px;
  }
}