/* styles.css - Unified Styles */

/* ==========================================================================
   IMPORTS & CSS CUSTOM PROPERTIES
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette */
  --bg-dark: #1C1C1C;
  --bg-light: #FFFFFF;
  --text-primary: #F5E8D8;
  --text-dark: #1C1C1C;
  --accent1: #E20074;
  --accent2: #0c0902;
  --hover: #FF4500;
  --border: rgba(245, 232, 216, 0.2);
  --shadow: rgba(0, 0, 0, 0.5);
  --info: #444444;
  --gradient: linear-gradient(45deg, var(--accent1), #ff6b9d);

  /* Layout */
  --container-max-width: 1024px;
  --border-radius: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-pill: 50px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* ==========================================================================
   BASE STYLES & RESET
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable both-edges;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  scrollbar-width: thin;
  scrollbar-color: var(--accent1) transparent;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* ==========================================================================
   LIGHT MODE THEME
   ========================================================================== */

body.light-mode {
  background-color: var(--bg-light);
  color: var(--text-dark);
}

body.light-mode h1,
body.light-mode h2,
body.light-mode h3,
body.light-mode h4,
body.light-mode h5 {
  color: var(--text-dark);
}

/* ==========================================================================
   LAYOUT COMPONENTS
   ========================================================================== */

.container {
  max-width: var(--container-max-width);
  margin: 2rem auto;
  padding: 0 1rem;
  background: transparent;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5 {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* Hero heading */
h1 {
  font-size: clamp(2.5rem, 8vw, 6rem);
  letter-spacing: 0.5rem;
  text-transform: uppercase;
  color: var(--accent1);
  text-align: center;
}

.info {
  color: var(--info);
}

.text-muted {
  color: var(--text-primary) !important;
}

body.light-mode .text-muted {
  color: var(--text-dark) !important;
  opacity: 0.7;
}

/* ==========================================================================
   FORM CONTROLS (UNIFIED)
   ========================================================================== */

.form-control,
.form-select {
  background-color: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--text-primary);
  transition: all var(--transition-normal);
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent1);
  box-shadow: 0 0 0 3px rgba(226, 0, 116, 0.25);
  background-color: white !important;
  color: var(--text-dark) !important;
}

.form-control::placeholder {
  color: rgba(245, 232, 216, 0.6);
}

/* Light mode form controls */
body.light-mode .form-control,
body.light-mode .form-select {
  background-color: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-dark);
}

body.light-mode .form-control:focus, 
body.light-mode .form-select:focus {
  background-color: white !important;
  border-color: var(--accent1);
  box-shadow: 0 0 0 3px rgba(226, 0, 116, 0.25);
  color: var(--text-dark) !important;
}

body.light-mode .form-control::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   PRICING TABLE - THEME INTEGRATION
   ========================================================================== */

/* Pricing table container */
#pricingResult {
  background-color: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  backdrop-filter: blur(10px);
  overflow: hidden;
}

/* Table styling for dark theme */
#pricingResult .table {
  width: 100%;
  color: var(--text-primary) !important;
  border-collapse: collapse;
  margin-bottom: 0;
  background-color: transparent;
}

#pricingResult .table th,
#pricingResult .table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border: none;
  border-bottom: 1px solid var(--border);
  background-color: transparent;
  color: var(--text-primary) !important;
}

/* Header styling */
#pricingResult .table-dark thead th {
  background-color: rgba(226, 0, 116, 0.1) !important;
  color: var(--accent1) !important;
  border-bottom: 2px solid var(--accent1) !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

/* Striped rows */
#pricingResult .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(245, 232, 216, 0.05);
}

#pricingResult .table-striped tbody tr:nth-of-type(even) {
  background-color: transparent;
}

/* Hover effects */
#pricingResult .table-hover tbody tr:hover {
  background-color: rgba(226, 0, 116, 0.1) !important;
}

/* Last row border */
#pricingResult .table tbody tr:last-child td {
  border-bottom: none;
}

/* Light mode pricing table */
body.light-mode #pricingResult {
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode #pricingResult .table {
  color: var(--text-dark);
}

body.light-mode #pricingResult .table th,
body.light-mode #pricingResult .table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-dark) !important;
}

body.light-mode #pricingResult .table-dark thead th {
  background-color: rgba(226, 0, 116, 0.05) !important;
  color: var(--accent1) !important;
  border-bottom: 2px solid var(--accent1) !important;
}

body.light-mode #pricingResult .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

body.light-mode #pricingResult .table-hover tbody tr:hover {
  background-color: rgba(226, 0, 116, 0.05) !important;
}

/* Responsive pricing table */
@media (max-width: 768px) {
  #pricingResult .table th,
  #pricingResult .table td {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
  
  #pricingResult .table-dark thead th {
    font-size: 0.8rem;
  }
}


/* ==========================================================================
   NAVIGATION TABS
   ========================================================================== */

.nav-tabs {
  border-bottom: none;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-tabs .nav-link {
  font-weight: 600;
  color: var(--text-primary) !important;
  background-color: var(--bg-dark);
  border: 2px solid var(--accent1);
  border-radius: var(--border-radius-pill);
  padding: 0.5rem 1.25rem;
  margin: 0.25rem;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.nav-tabs .nav-link:hover {
  color: var(--hover) !important;
  box-shadow: 0 4px 12px rgba(255, 69, 0, 0.3);
  transform: translateY(-2px);
}

.nav-tabs .nav-link.active {
  background-color: var(--bg-dark);
  color: var(--accent1) !important;
  border-color: var(--accent1);
  box-shadow: 0 4px 12px var(--accent2);
}

/* Light mode navigation */
body.light-mode .nav-tabs .nav-link {
  background-color: var(--bg-light);
  color: var(--text-dark) !important;
}

body.light-mode .nav-tabs .nav-link.active {
  background-color: var(--bg-light);
  color: var(--accent1) !important;
  border-color: var(--accent1);
  box-shadow: 0 4px 12px var(--accent2);
}

/* ==========================================================================
   BUTTONS (UNIFIED)
   ========================================================================== */

.btn {
  font-family: inherit;
  font-weight: 500;
  border-radius: var(--border-radius-pill);
  padding: 0.75rem 2rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  border: 2px solid var(--accent1);
  background: transparent;
  color: var(--text-primary);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  background: var(--hover);
  color: var(--bg-dark);
  box-shadow: 0 8px 24px var(--shadow);
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Special button styles */
.btn-login {
  background: var(--gradient);
  border: none;
  color: white;
  font-weight: 600;
  letter-spacing: 1px;
}

.btn-login:hover:not(:disabled) {
  background: var(--gradient);
  color: white;
  box-shadow: 0 8px 25px rgba(226, 0, 116, 0.4);
}

/* Specialized buttons */
.copy-sms,
.expand-sms {
  border: 2px solid var(--accent1);
  background: transparent;
  color: var(--text-primary);
  border-radius: var(--border-radius-pill);
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: normal;
}

.copy-sms:hover,
.expand-sms:hover {
  background: var(--hover);
  color: var(--bg-dark);
  box-shadow: 0 4px 12px var(--shadow);
}

/* Light mode buttons */
body.light-mode .btn {
  background: var(--bg-light);
  color: var(--text-dark);
  border-color: var(--accent1);
}

body.light-mode .btn:hover:not(.btn-login) {
  background: var(--hover);
  color: var(--bg-light);
  box-shadow: 0 8px 24px var(--shadow);
}

body.light-mode .copy-sms,
body.light-mode .expand-sms {
  background: var(--bg-light);
  color: var(--text-dark);
  border-color: var(--accent1);
}

body.light-mode .copy-sms:hover,
body.light-mode .expand-sms:hover {
  background: var(--hover);
  color: var(--bg-light);
  box-shadow: 0 4px 12px var(--shadow);
}

/* Close buttons */
.card .btn-close {
  filter: invert(1);
}

body.light-mode .card .btn-close {
  filter: invert(0);
}

/* ==========================================================================
   CARDS & GRID LAYOUTS
   ========================================================================== */

#deviceList {
  margin-top: 1.5rem;
  display: grid;
  gap: 1.5rem;
  justify-content: center;
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

#deviceList > .col-md-4 {
  width: 100% !important;
  flex: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.card {
  background-color: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 12px var(--shadow);
  transition: all var(--transition-normal);
  color: var(--text-primary);
  width: 100%;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.card-body {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px var(--accent2);
}

/* Light mode cards */
body.light-mode .card {
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--text-dark);
  border: 1px solid var(--border);
}

body.light-mode .card:hover {
  box-shadow: 0 8px 20px var(--accent2);
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.table-responsive {
  margin-bottom: 1rem;
}

.table {
  width: 100%;
  color: var(--text-primary);
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border: none;
}

.table-dark thead th {
  background-color: var(--bg-dark) !important;
  color: var(--accent1) !important;
  border-bottom: 2px solid var(--accent1) !important;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(245, 232, 216, 0.05);
}

.table-hover tbody tr:hover {
  background-color: var(--hover);
}

/* Light mode tables */
body.light-mode .table {
  color: var(--text-dark);
}

body.light-mode .table-dark thead th {
  background-color: var(--bg-light) !important;
  color: var(--accent1) !important;
}

body.light-mode .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

/* ==========================================================================
   LISTS & CONTENT CONTAINERS
   ========================================================================== */

/* SMS list items */
#smsList .list-group-item {
  background: transparent;
  border: none;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  transition: all var(--transition-normal);
}

#smsList .list-group-item:last-child {
  border-bottom: none;
}

#smsList .list-group-item:hover {
  background: rgba(226, 0, 116, 0.1);
  border-radius: var(--border-radius);
  border-bottom: 1px solid var(--border);
}

#smsList .ms-2 {
  flex: 1;
  min-width: 0;
}

#smsList small {
  display: block;
}

#smsList small.text-truncate {
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis;
}

/* Light mode SMS list */
body.light-mode #smsList .list-group-item {
  background: var(--bg-light);
  color: var(--text-dark);
  border-bottom: 1px solid var(--border);
}

body.light-mode #smsList .list-group-item:hover {
  background: rgba(226, 0, 116, 0.05);
}

/* Email content container */
#emailContent,
#inttvEmailContent {
  background-color: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  backdrop-filter: blur(10px);
}

#emailContent h2,
#emailContent h3,
#inttvEmailContent h2,
#inttvEmailContent h3 {
  color: var(--text-primary);
}

/* Light mode email content */
body.light-mode #emailContent,
body.light-mode #inttvEmailContent {
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-dark);
}

body.light-mode #emailContent h2,
body.light-mode #emailContent h3,
body.light-mode #inttvEmailContent h2,
body.light-mode #inttvEmailContent h3 {
  color: var(--text-dark);
}

/* ==========================================================================
   PHONE TRACKER COMPONENTS
   ========================================================================== */

.phone-entry-card {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
}

.phone-entry-card:hover {
  transform: translateX(5px);
  border-color: var(--accent1);
  box-shadow: 0 2px 8px rgba(226, 0, 116, 0.2);
}

.delete-btn {
  opacity: 0.7;
  transition: opacity var(--transition-fast);
  min-width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.delete-btn:hover {
  opacity: 1;
  background-color: #dc3545;
}

.stats-card {
  background: rgba(0, 0, 0, 0.6);
  border-radius: var(--border-radius);
  padding: 0.75rem;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
}

.stats-card h4 {
  color: var(--text-primary);
  margin-bottom: 0;
}

.stats-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

/* Phone tracker tab specific */
#phoneTrackerTab .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  margin: 0 2px;
}

#phoneTrackerTab .form-check-input:checked {
  background-color: var(--accent1);
  border-color: var(--accent1);
}

/* Light mode phone tracker */
body.light-mode .phone-entry-card,
body.light-mode .stats-card {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-dark);
  border: 1px solid var(--border);
}

/* ==========================================================================
   LOGIN SYSTEM (UNIFIED)
   ========================================================================== */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #2C2C2C 100%);
}

.login-card {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid var(--accent1);
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 100%;
  margin: 2rem;
  overflow: hidden;
}

.login-header {
  background: var(--gradient);
  color: white;
  text-align: center;
  padding: 2rem;
}

.login-body {
  padding: 2rem;
}

/* Login form controls override */
.login-body .form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 10px;
}

.login-body .form-control:focus {
  background: white !important;
  border-color: var(--accent1);
  color: var(--text-dark) !important;
}

.login-body .form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* Input group for password toggle */
.input-group {
  position: relative;
}

.input-group .toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  z-index: 5;
  padding: 0.25rem;
  transition: color var(--transition-fast);
}

.input-group .toggle-password:hover {
  color: white;
}

/* Special components */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.error-message {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid #dc3545;
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 1rem;
  animation: shake 0.5s ease-in-out;
}

.caps-lock-warning {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #ffc107;
}

/* Light mode login */
body.light-mode .login-container {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

body.light-mode .login-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--accent1);
}

body.light-mode .login-body .form-control {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-dark);
}

body.light-mode .login-body .form-control:focus {
  background: white !important;
  color: var(--text-dark) !important;
}

body.light-mode .login-body .form-control::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

body.light-mode .input-group .toggle-password {
  color: rgba(0, 0, 0, 0.6);
}

body.light-mode .input-group .toggle-password:hover {
  color: var(--text-dark);
}

/* ==========================================================================
   AUTOCOMPLETE & SUGGESTIONS
   ========================================================================== */

.suggestions {
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-dark);
  color: var(--text-primary);
  border: 1px solid var(--accent1);
  border-radius: var(--border-radius);
  z-index: 2000;
  display: none;
  backdrop-filter: blur(10px);
}

body.light-mode .suggestions {
  background-color: var(--bg-light) !important;
  color: var(--text-dark) !important;
}

/* ==========================================================================
   MAP STYLES (LEAFLET)
   ========================================================================== */

.leaflet-control-search {
  font-family: 'Inter', sans-serif !important;
  font-size: 1rem;
  background-color: var(--bg-dark);
  border: 2px solid var(--accent1);
  border-radius: var(--border-radius-pill);
  padding: 0.25rem 1rem;
  box-shadow: 0 4px 12px var(--shadow);
  color: var(--text-primary);
}

.leaflet-control-search input {
  background-color: transparent;
  border: none;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  outline: none;
}

.leaflet-control-search .search-tooltip {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  border: 1px solid var(--accent1);
  border-radius: var(--border-radius);
  color: var(--text-primary);
}

.leaflet-control-search .search-tip-select {
  background-color: var(--hover) !important;
  color: var(--bg-dark) !important;
}

.magenta-dot {
  width: 12px;
  height: 12px;
  background: var(--accent1);
  border: 2px solid var(--accent1);
  border-radius: 50%;
}

/* Light mode map controls */
body.light-mode .leaflet-control-search {
  background-color: var(--bg-light);
  border-color: var(--accent1);
  color: var(--text-dark);
}

body.light-mode .leaflet-control-search input {
  color: var(--text-dark);
}

body.light-mode .leaflet-control-search .search-tooltip {
  background-color: var(--bg-light);
  color: var(--text-dark);
}

/* ==========================================================================
   UI COMPONENTS
   ========================================================================== */

/* Update request panel */
#updateRequestContainer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1050;
}

#updateRequestToggle {
  width: 50px;
  height: 50px;
  border-radius: 25px;
  padding: 0;
  overflow: hidden;
  transition: width 0.3s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

#updateRequestToggle::before {
  content: "📧";
  font-size: 20px;
  min-width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#updateRequestToggle .btn-text {
  margin-left: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#updateRequestToggle:hover {
  width: 200px;
  padding-right: 15px;
}

#updateRequestToggle:hover .btn-text {
  opacity: 1;
}


#updateRequestToggle:hover::after {
  animation: none;
}

/* ==========================================================================
   ANIMATIONS & KEYFRAMES
   ========================================================================== */

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

/* ==========================================================================
   SCROLLBAR STYLING
   ========================================================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--accent1);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--hover);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
  .nav-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .nav-tabs .nav-link {
    font-size: 0.875rem;
    padding: 0.4rem 1rem;
  }
  
  .login-card {
    margin: 1rem;
  }
  
  .login-header,
  .login-body {
    padding: 1.5rem;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 0.5rem;
    margin: 1rem auto;
  }

  #deviceList {
    grid-template-columns: 1fr;
  }

  h1 {
    letter-spacing: 0.2rem;
    font-size: clamp(2rem, 8vw, 4rem);
  }

  .btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
  }

  .nav-tabs .nav-link {
    padding: 0.4rem 0.8rem;
    margin: 0.125rem;
    font-size: 0.8rem;
  }

  .phone-entry-card .d-flex {
    flex-direction: column;
  }

  .phone-entry-card .delete-btn {
    margin-top: 0.5rem;
    margin-left: 0 !important;
    width: 100%;
    border-radius: var(--border-radius);
  }

  .card-body {
    padding: 1rem;
  }

  .stats-card {
    padding: 0.5rem;
  }
}