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

/* Основные стили */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #000000;
  color: #ffffff;
  min-height: 100vh;
  line-height: 1.4;
  overflow-x: hidden;
}

.app {
  min-height: 100vh;
  position: relative;
  background: radial-gradient(ellipse at center, #1a1a1a 0%, #000000 70%);
}

.container {
  max-width: 420px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Основной контент */
.main {
  padding: 40px 0;
}

/* Экраны */
.screen {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(30px) scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

/* Заголовки экранов */
.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 0 10px;
}

.screen-header h2 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff, #888888);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  width: 100%;
}

.logout-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

/* Карточки */
.card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 20px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: center;
}

.card h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff, #cccccc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 20px;
  font-size: 1rem;
}

/* Информация о пользователе */
.user-info {
  display: none;
}

/* Авторизация */
.auth-center {
  margin: 40px 0;
}

.auth-btn-primary {
  background: linear-gradient(145deg, #4CAF50, #45a049);
  border: none;
  color: #ffffff;
  padding: 20px 40px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: block;
  width: 100%;
  margin: 20px 0;
  box-shadow: 
    0 8px 25px rgba(76, 175, 80, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-btn-primary:hover {
  background: linear-gradient(145deg, #45a049, #4CAF50);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 12px 35px rgba(76, 175, 80, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.auth-note {
  background: linear-gradient(145deg, rgba(255, 193, 7, 0.15), rgba(255, 193, 7, 0.05));
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 16px;
  padding: 20px;
  margin: 20px 0;
  color: #fff3cd;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
}

.auth-note p {
  margin: 8px 0;
  color: #fff3cd;
}

.manual-auth-link {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.link-btn {
  background: none;
  border: none;
  color: #4CAF50;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: underline;
  transition: all 0.3s ease;
  padding: 8px;
}

.link-btn:hover {
  color: #66BB6A;
  transform: scale(1.05);
}

/* Форма ручной авторизации */
#manual-auth {
  margin-top: 20px;
  padding: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

#manual-auth input {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 16px;
  border-radius: 12px;
  font-size: 1rem;
  margin-bottom: 16px;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

#manual-auth input:focus {
  outline: none;
  border-color: #4CAF50;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

#manual-auth input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.submit-btn, .cancel-btn {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.submit-btn {
  background: linear-gradient(145deg, #4CAF50, #45a049);
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.cancel-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.cancel-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* Билеты */
.ticket-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.ticket-card:hover {
  transform: none;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
}

.ticket-header {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  padding: 20px 24px;
  color: white;
  border-radius: 16px 16px 0 0;
}

.ticket-subtitle {
  font-size: 1.2rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.ticket-body {
  padding: 24px;
}

.ticket-field {
  margin-bottom: 16px;
}

.ticket-field:last-child {
  margin-bottom: 0;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.field-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  word-break: break-word;
}

/* Стили для статусов */
.field-value.status {
  padding: 0;
  border-radius: 0;
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  display: block;
  background: none;
  color: rgba(255, 255, 255, 0.8);
  border: none;
  box-shadow: none;
}

/* Стили для скрытого номера билета */
.ticket-number {
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.ticket-number:hover {
  opacity: 0.8;
}

.ticket-number .blurred {
  color: #ffffff;
  font-family: monospace;
  filter: blur(4px);
  transition: filter 0.3s ease;
}

.ticket-number .revealed {
  color: #ffffff;
  font-family: monospace;
}

.ticket-barcode {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.qr-code {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.qr-code canvas {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px;
}

.barcode-text {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
}

/* Нет билетов */
.no-tickets .card {
  text-align: center;
  padding: 40px;
}

.no-tickets h3 {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.no-tickets p {
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 25px;
}

/* Загрузка */
.loading {
  text-align: center;
  padding: 30px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.global-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.global-loading .spinner {
  width: 60px;
  height: 60px;
  border-width: 4px;
}

/* Уведомления */
.notification {
  position: fixed;
  top: 30px;
  right: 20px;
  background: linear-gradient(145deg, rgba(76, 175, 80, 0.95), rgba(76, 175, 80, 0.85));
  color: #ffffff;
  padding: 16px 24px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transform: translateX(400px);
  transition: all 0.4s ease;
  z-index: 1001;
  max-width: 320px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 500;
}

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

.notification.error {
  background: linear-gradient(145deg, rgba(244, 67, 54, 0.95), rgba(244, 67, 54, 0.85));
}

/* Адаптивность */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  
  .card {
    padding: 24px;
    border-radius: 20px;
  }
  
  .ticket-card {
    padding: 20px;
  }
  
  .notification {
    right: 16px;
    left: 16px;
    max-width: none;
    transform: translateY(-100px);
  }
  
  .notification.show {
    transform: translateY(0);
  }
  
  .screen-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .ticket-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .detail-row {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  
  .detail-value {
    text-align: center;
    max-width: 100%;
  }
  
  .auth-btn-primary {
    padding: 18px 32px;
    font-size: 1rem;
  }
}
