* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 500px;
  padding: 20px;
}

.payment-form {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  position: relative;
}

.payment-form h1 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
  font-size: 28px;
  font-weight: 600;
}

.form-section {
  margin-bottom: 30px;
}

.form-section h2 {
  color: #555;
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 500;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 15px;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
  font-size: 14px;
}

input {
  width: 100%;
  padding: 15px;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

input:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.hidden {
  display: none !important;
}

/* Анимация загрузки */
.loading-section {
  text-align: center;
  padding: 40px 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Уведомления */
.notification {
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
  font-weight: 500;
}

.notification.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.notification.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.notification.warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* Страница благодарности */
.thank-you-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.thank-you-content {
  background: white;
  border-radius: 20px;
  padding: 60px 40px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.thank-you-content h1 {
  color: #333;
  margin-bottom: 20px;
  font-size: 32px;
  font-weight: 600;
}

.thank-you-content p {
  color: #666;
  font-size: 18px;
  margin-bottom: 30px;
}

/* Адаптивность */
@media (max-width: 600px) {
  .container {
    padding: 10px;
  }

  .payment-form {
    padding: 30px 20px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .thank-you-content {
    padding: 40px 20px;
    margin: 20px;
  }
}

/* Анимации появления */
.form-section {
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Темная тема для админки */
.admin-body {
  background: #1a1a1a !important;
  color: #ffffff;
}

.admin-container {
  background: #2d2d2d;
  min-height: 100vh;
  padding: 20px;
}

.admin-header {
  background: #3a3a3a;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  border: 1px solid #4a4a4a;
}

.admin-section {
  background: #3a3a3a;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  border: 1px solid #4a4a4a;
}

.admin-section h2 {
  color: #ffffff;
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 600;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.data-table th,
.data-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #4a4a4a;
  color: #ffffff;
}

.data-table th {
  background: #4a4a4a;
  font-weight: 600;
  color: #ffffff;
}

.data-table tr:hover {
  background: #4a4a4a;
}

/* Стили для выпадающих списков */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  background: #667eea;
  color: white;
  padding: 8px 12px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: #3a3a3a;
  min-width: 160px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  z-index: 1;
  border: 1px solid #4a4a4a;
  border-radius: 5px;
}

.dropdown-content a {
  color: #ffffff;
  padding: 8px 12px;
  text-decoration: none;
  display: block;
  font-size: 12px;
}

.dropdown-content a:hover {
  background: #4a4a4a;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.chat-container {
  height: 400px;
  border: 1px solid #4a4a4a;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background: #2d2d2d;
}

.chat-input {
  display: flex;
  padding: 15px;
  border-top: 1px solid #4a4a4a;
  background: #3a3a3a;
}

.chat-input input {
  flex: 1;
  margin-right: 10px;
  background: #2d2d2d;
  border: 1px solid #4a4a4a;
  color: #ffffff;
}

.chat-input input::placeholder {
  color: #999;
}

.chat-input button {
  padding: 10px 20px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.message {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 10px;
  max-width: 80%;
}

.message.admin {
  background: #667eea;
  color: white;
  margin-left: auto;
}

.message.user {
  background: #4a4a4a;
  color: #ffffff;
  border: 1px solid #5a5a5a;
}

.message-time {
  font-size: 12px;
  color: #999;
  margin-top: 5px;
}

/* Стили для логотипов карт */
.card-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.card-logos {
  position: absolute;
  right: 15px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.card-logo {
  height: 20px;
  width: auto;
  object-fit: contain;
  filter: brightness(0.8);
  transition: all 0.3s ease;
}

.card-logo.visa {
  height: 18px;
}

.card-logo.mastercard {
  height: 22px;
}

/* Анимация для логотипов */
.card-logo {
  transition: all 0.3s ease;
}

.card-logo:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Стили для модального окна */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background: #3a3a3a;
  margin: 5% auto;
  padding: 0;
  border-radius: 10px;
  width: 80%;
  max-width: 600px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid #4a4a4a;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #4a4a4a;
  background: #4a4a4a;
  border-radius: 10px 10px 0 0;
}

.modal-header h2 {
  margin: 0;
  color: #ffffff;
}

.close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close:hover {
  color: #ffffff;
}

/* Анимация появления модального окна */
.modal.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Стили для уведомлений о сообщениях от админа */
.admin-messages {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 300px;
}

.admin-message {
  background: #667eea;
  color: white;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  animation: slideInRight 0.3s ease;
  font-size: 14px;
  line-height: 1.4;
}

.admin-message .message-time {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 5px;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Стили для настроек звука */
.sound-settings {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sound-control {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #4a4a4a;
  border-radius: 5px;
  border: 1px solid #5a5a5a;
}

.sound-control label {
  margin: 0;
  color: #ffffff;
  font-weight: 500;
}

.sound-control input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.sound-control input[type="file"] {
  background: #2d2d2d;
  border: 1px solid #4a4a4a;
  color: #ffffff;
  padding: 8px;
  border-radius: 5px;
}

.sound-control input[type="file"]::-webkit-file-upload-button {
  background: #667eea;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 3px;
  cursor: pointer;
  margin-right: 10px;
}

/* QR Modal */
#qrModal .modal-content {
  max-width: 400px;
  width: 95%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 0 0 20px 0;
}
.qr-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 60vh;
  overflow-y: auto;
}
.qr-upload-block,
.qr-generate-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Оверлей QR на клиенте */
#qrOverlay {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
#qrOverlay.show {
  display: flex;
}
#qrOverlay img {
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  border-radius: 20px;
  background: white;
  padding: 20px;
}
#qrOverlay .close {
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  position: absolute;
  top: 30px;
  right: 40px;
  cursor: pointer;
  z-index: 2100;
  transition: color 0.3s;
}
#qrOverlay .close:hover {
  color: #ff5252;
}
