/* Netdolgoff Mobile App - Аутентичный дизайн сайта */

/* Точная цветовая палитра из брендбука Netdolgoff */
:root {
  /* Основные брендовые цвета */
  --netdolgoff-yellow: #ffe599; /* Основной желтый из брендбука */
  --netdolgoff-yellow-hover: #ffbe46; /* Желтый при наведении */
  --netdolgoff-yellow-light: #ffefd7; /* Светлый желтый */
  --netdolgoff-dark: #333333; /* Основной темно-серый */
  --netdolgoff-dark-text: #333333; /* Темно-серый текст */
  --netdolgoff-medium-text: #666666; /* Средний серый текст */
  --netdolgoff-light-text: #999999; /* Светлый серый текст */
  --netdolgoff-bg: #ffffff; /* Белый фон */
  --netdolgoff-bg-light: #f8f9fa; /* Светло-серый фон */
  --netdolgoff-white: #ffffff; /* Белый */
  --netdolgoff-border: #eeeeee; /* Светлые границы */

  /* Дополнительные цвета */
  --success-color: #27ae60; /* Зеленый успех */
  --warning-color: #f39c12; /* Оранжевый предупреждение */
  --error-color: #e74c3c; /* Красный ошибка */

  /* Тени как на сайте */
  --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-strong: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Сброс стилей */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial,
    sans-serif;
  background: var(--netdolgoff-bg-light);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

/* Мобильный контейнер */
.mobile-container {
  width: 375px;
  height: 812px;
  background: var(--netdolgoff-white);
  border-radius: 20px;
  box-shadow: var(--shadow-strong);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--netdolgoff-border);
}

/* Статус бар iPhone */
.status-bar {
  height: 44px;
  background: var(--netdolgoff-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  color: var(--netdolgoff-dark-text);
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--netdolgoff-border);
}

.status-right {
  display: flex;
  gap: 6px;
  font-size: 12px;
}

/* Заголовок приложения в стиле сайта */
.app-header {
  background: var(--netdolgoff-white);
  padding: 16px 20px;
  border-bottom: 1px solid var(--netdolgoff-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-logo {
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
  /* Увеличенный размер для максимальной читаемости текста */
  width: 160px;
  height: 44px;
}

.notification-btn {
  background: var(--netdolgoff-yellow);
  border: none;
  position: relative;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 600;
  color: var(--netdolgoff-dark-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.notification-btn:hover {
  background: var(--netdolgoff-yellow-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--error-color);
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Контент экранов */
.screen-content {
  flex: 1;
  overflow-y: auto;
  background: var(--netdolgoff-bg);
}

.screen {
  display: none;
  padding: 20px;
  min-height: 100%;
}

.screen.active {
  display: block;
}

/* Карточки в стиле сайта */
.card {
  background: var(--netdolgoff-white);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--netdolgoff-border);
}

.welcome-card {
  background: var(--netdolgoff-white);
  color: var(--netdolgoff-dark-text);
  text-align: center;
  margin-bottom: 24px;
  border-left: 4px solid var(--netdolgoff-yellow);
}

.welcome-logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.welcome-logo {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  /* Обеспечиваем правильные пропорции для большого оригинального логотипа */
  max-width: 144px;
  max-height: 40px;
}

.welcome-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--netdolgoff-dark-text);
}

.welcome-card p {
  color: var(--netdolgoff-medium-text);
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 15px;
}

/* Статистика */
.stats-row {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--netdolgoff-border);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--netdolgoff-yellow);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--netdolgoff-light-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Прогресс бар */
.progress-container {
  margin: 20px 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--netdolgoff-dark-text);
}

.progress-bar {
  height: 8px;
  background: var(--netdolgoff-border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--netdolgoff-yellow) 0%,
    var(--netdolgoff-yellow-hover) 100%
  );
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Быстрые действия в стиле сайта */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.action-btn {
  background: var(--netdolgoff-white);
  border: 1px solid var(--netdolgoff-border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--netdolgoff-dark-text);
}

.action-btn:hover {
  border-color: var(--netdolgoff-yellow);
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
}

.action-btn i {
  font-size: 24px;
  color: var(--netdolgoff-yellow);
  margin-bottom: 8px;
  display: block;
}

.action-btn span {
  font-size: 13px;
  font-weight: 600;
  display: block;
  color: var(--netdolgoff-medium-text);
}

/* Таймлайн */
.timeline {
  margin: 24px 0;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  position: relative;
}

.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  width: 2px;
  height: calc(100% + 8px);
  background: var(--netdolgoff-border);
}

.timeline-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--netdolgoff-border);
}

.timeline-icon.completed {
  background: var(--success-color);
  color: white;
  border-color: var(--success-color);
}

.timeline-icon.current {
  background: var(--netdolgoff-yellow);
  color: var(--netdolgoff-dark-text);
  border-color: var(--netdolgoff-yellow);
}

.timeline-icon.pending {
  background: var(--netdolgoff-white);
  color: var(--netdolgoff-light-text);
}

.timeline-content h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--netdolgoff-dark-text);
  margin-bottom: 4px;
}

.timeline-content p {
  font-size: 14px;
  color: var(--netdolgoff-medium-text);
  line-height: 1.4;
}

/* Документы */
.document-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--netdolgoff-border);
}

.document-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--netdolgoff-dark-text);
}

.add-btn {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--netdolgoff-yellow);
  color: var(--netdolgoff-dark-text);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s;
}

.add-btn:hover {
  background: var(--netdolgoff-yellow-hover);
  transform: scale(1.05);
}

.document-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.document-item {
  background: var(--netdolgoff-white);
  border: 1px solid var(--netdolgoff-border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.document-item:hover {
  border-color: var(--netdolgoff-yellow);
  box-shadow: var(--shadow-light);
  transform: translateX(2px);
}

.document-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--netdolgoff-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  color: var(--netdolgoff-yellow);
  font-size: 18px;
}

.document-info {
  flex: 1;
  min-width: 0; /* Важно для работы text-overflow внутри flex */
}

.document-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--netdolgoff-dark-text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-filename {
  font-size: 12px;
  color: var(--netdolgoff-light-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Статус пиллы */
.status-pill {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-pill.success {
  background: rgba(39, 174, 96, 0.1);
  color: var(--success-color);
}

.status-pill.pending {
  background: rgba(243, 156, 18, 0.1);
  color: var(--warning-color);
}

.status-pill.error {
  background: rgba(231, 76, 60, 0.1);
  color: var(--error-color);
}

/* Чат */
.chat-header {
  background: var(--netdolgoff-white);
  padding: 16px;
  border-bottom: 1px solid var(--netdolgoff-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h3 {
  color: var(--netdolgoff-dark-text);
  font-size: 16px;
  font-weight: 600;
}

.ai-toggle-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-toggle-label {
  font-size: 12px;
  color: var(--netdolgoff-medium-text);
  font-weight: 600;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--netdolgoff-border);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.toggle-switch.active {
  background: var(--netdolgoff-yellow);
}

.toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--netdolgoff-white);
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: var(--shadow-light);
}

.toggle-switch.active .toggle-slider {
  transform: translateX(20px);
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
}

.message.outgoing {
  align-self: flex-end;
  background: var(--netdolgoff-yellow);
  color: var(--netdolgoff-dark-text);
  border-bottom-right-radius: 4px;
}

.message.incoming {
  align-self: flex-start;
  background: var(--netdolgoff-white);
  color: var(--netdolgoff-dark-text);
  border: 1px solid var(--netdolgoff-border);
  border-bottom-left-radius: 4px;
}

/* Индикатор печати ИИ */
.loading-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  background: var(--netdolgoff-medium-text);
  border-radius: 50%;
  animation: loadingDots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}
.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes loadingDots {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

.chat-input-container {
  padding: 16px;
  background: var(--netdolgoff-white);
  border-top: 1px solid var(--netdolgoff-border);
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--netdolgoff-border);
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: var(--netdolgoff-yellow);
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--netdolgoff-yellow);
  color: var(--netdolgoff-dark-text);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.send-btn:hover {
  background: var(--netdolgoff-yellow-hover);
  transform: scale(1.05);
}

/* Оплаты */
.payment-summary {
  background: var(--netdolgoff-white);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  text-align: center;
  border: 1px solid var(--netdolgoff-border);
  border-left: 4px solid var(--netdolgoff-yellow);
}

.payment-amount {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--netdolgoff-dark-text);
}

.payment-description {
  color: var(--netdolgoff-medium-text);
  margin-bottom: 20px;
  font-size: 15px;
}

.payment-progress {
  background: var(--netdolgoff-border);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.payment-progress-fill {
  height: 100%;
  background: var(--netdolgoff-yellow);
  border-radius: 4px;
  width: 50%;
  transition: width 0.3s ease;
}

.payment-status {
  font-size: 14px;
  color: var(--netdolgoff-medium-text);
  font-weight: 500;
}

.qr-btn {
  background: var(--netdolgoff-yellow);
  color: var(--netdolgoff-dark-text);
  border: none;
  padding: 14px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 16px;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qr-btn:hover {
  background: var(--netdolgoff-yellow-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

/* Профиль */
.profile-header {
  text-align: center;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--netdolgoff-white);
  border-radius: 8px;
  border: 1px solid var(--netdolgoff-border);
}

.profile-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--netdolgoff-yellow);
  color: var(--netdolgoff-dark-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 16px;
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--netdolgoff-dark-text);
  margin-bottom: 4px;
}

.profile-phone {
  color: var(--netdolgoff-medium-text);
  font-size: 15px;
}

.profile-section {
  margin-bottom: 20px;
}

.profile-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--netdolgoff-dark-text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--netdolgoff-border);
}

.profile-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(232, 234, 237, 0.5);
}

.profile-field:last-child {
  border-bottom: none;
}

.profile-field-label {
  color: var(--netdolgoff-light-text);
  font-size: 13px;
  font-weight: 500;
}

.profile-field-value {
  color: var(--netdolgoff-dark-text);
  font-weight: 600;
  font-size: 13px;
}

/* Нижняя навигация */
.bottom-nav {
  background: var(--netdolgoff-white);
  border-top: 1px solid var(--netdolgoff-border);
  padding: 8px 0;
  display: flex;
  justify-content: space-around;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 6px;
  text-decoration: none;
  color: var(--netdolgoff-light-text);
}

.nav-item.active {
  color: var(--netdolgoff-yellow);
  background: rgba(244, 208, 63, 0.1);
}

.nav-item i {
  font-size: 18px;
  margin-bottom: 4px;
}

.nav-item span {
  font-size: 11px;
  font-weight: 600;
}

/* Модальные окна */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(44, 62, 80, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--netdolgoff-white);
  border-radius: 12px;
  padding: 24px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  border: 1px solid var(--netdolgoff-border);
  box-shadow: var(--shadow-strong);
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-header {
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--netdolgoff-dark-text);
  margin-bottom: 8px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--netdolgoff-light-text);
  cursor: pointer;
}

/* Уведомления */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--netdolgoff-white);
  border: 1px solid var(--netdolgoff-border);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-medium);
  z-index: 1001;
  max-width: 300px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  border-left: 4px solid var(--success-color);
}

.notification.error {
  border-left: 4px solid var(--error-color);
}

.notification.warning {
  border-left: 4px solid var(--warning-color);
}

.notification.info {
  border-left: 4px solid var(--netdolgoff-yellow);
}

/* Анимации */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen {
  animation: fadeIn 0.3s ease;
}

/* Адаптивность */
@media (max-width: 480px) {
  body {
    padding: 0;
  }

  .mobile-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
  }
}

/* Скроллбар */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--netdolgoff-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--netdolgoff-yellow);
  border-radius: 2px;
}

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

/* ============================================
   АНИМАЦИИ
   ============================================ */

/* Анимация индикатора "печатает..." */
@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Fade in для уведомлений */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pulse для статуса онлайн */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
