:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #181b20;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Глобальные ограничения для адаптивности */
html {
  margin: 0;
  padding: 0;
  min-width: 350px;
  box-sizing: border-box;
  overflow-x: auto;
}

*, *::before, *::after {
  box-sizing: border-box;
}

a {
  font-weight: 500;
  color: #646cff;
  text-decoration: inherit;
}
a:hover {
  color: #535bf2;
}

body {
  margin: 0;
  padding: 0;
  min-width: 350px;
  min-height: 100vh;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}
button:hover {
  border-color: #646cff;
}
button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

/* Force dark theme for all form elements (prevent mobile browser light overrides) */
input, textarea, select {
  background-color: #23272e;
  color: #fff;
  border-color: #3a4150;
}

input::placeholder, textarea::placeholder {
  color: #6b7280;
  opacity: 1;
}

/* Override select option styling for dark theme */
option {
  background-color: #23272e;
  color: #fff;
}
/* Глобальные стили для адаптивности и центрирования */
#root {
  width: 100%;
  min-width: 350px;
  max-width: 100vw;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Основные контейнеры */
.main-layout {
  width: 100%;
  min-width: 350px;
  max-width: 100vw;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto;
}

/* Контейнеры с максимальной шириной */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(10px, 3vw, 20px);
  box-sizing: border-box;
}

/* Адаптивные стили */
@media (max-width: 349px) {
  #root, .main-layout, .container {
    min-width: 350px !important;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 clamp(8px, 2vw, 16px);
  }
}

@media (min-width: 1201px) {
  .container {
    max-width: 1200px;
    width: 1200px;
  }
}

/* Предотвращение горизонтального скролла */
html, body {
  overflow-x: hidden;
  overflow-y: auto;
}

/* Стили карточек */
.card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Адаптивные изображения */
img {
  max-width: 100%;
  height: auto;
}

/* Адаптивные таблицы */
table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

@media (max-width: 768px) {
  table {
    font-size: 0.875rem;
  }
}
c /* DeviceSettingsModal styles */
.device-settings-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  width: 100vw !important;
  min-height: 100vh !important;
  height: auto !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  z-index: 999999 !important;
  margin: 0 !important;
  padding: 20px 0 !important;
  box-sizing: border-box !important;
  overflow: auto !important;
  background-color: transparent !important;
  animation: fadeIn 0.3s ease-out !important;
}

.device-settings-modal-content {
  position: relative !important;
  margin: 20px 0 !important;
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: fit-content !important;
  overflow: visible !important;
  filter: none !important;
  display: flex !important;
  flex-direction: column !important;
}

.action-button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  will-change: transform, box-shadow !important;
}

.action-button:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.action-button:active:not(:disabled) {
  transform: translateY(-1px) scale(0.98) !important;
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.action-button:disabled {
  animation: gentle-pulse 2s infinite !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes gentle-pulse {
  0% { opacity: 0.6; }
  50% { opacity: 0.8; }
  100% { opacity: 0.6; }
}

@keyframes online-pulse {
  0% { opacity: 1; box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
  70% { opacity: 1; box-shadow: 0 0 0 4px rgba(76, 175, 80, 0); }
  100% { opacity: 1; box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

@keyframes slideInFromRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
/* Delete confirmation modal styles — dark theme */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-dialog {
  background: #23272e;
  border: 1px solid #3a3f47;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(1);
  transition: transform 0.2s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #3a3f47;
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #adb5bd;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover:not(:disabled) {
  background: #3a3f47;
  color: #fff;
}

.modal-close:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.warning-icon {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 16px;
}

.modal-body p {
  margin: 0 0 16px;
  color: #e0e0e0;
  line-height: 1.5;
}

.archive-info {
  background: #181b20;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  border-left: 4px solid #007bff;
}

.archive-info div {
  margin: 8px 0;
  font-size: 0.9rem;
  color: #adb5bd;
}

.warning-text {
  color: #ff6b6b;
  font-weight: 500;
  text-align: center;
  margin-top: 16px !important;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px 24px;
  border-top: 1px solid #3a3f47;
  flex-shrink: 0;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #5a6268;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #c82333;
}

/* Modal appear animation */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-dialog {
  animation: modalFadeIn 0.2s ease-out;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 10px;
  }
  
  .modal-dialog {
    max-width: 100%;
    margin: 0;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}
/* src/styles/global.css */
html, body, #root {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  background-color: #1e1e1e;
  color: white;
  font-family: Arial, sans-serif;
}

input, button {
  box-sizing: border-box;
}

/* Анимация загрузки для спиннера */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-spinner {
  animation: spin 1s linear infinite;
}