/* ====================================
   Call UI Components - Tier Badges, Timer, Upgrade Modals
   ==================================== */

/* =====================================
   ИНФОРМАЦИОННАЯ ПАНЕЛЬ (INFO PANEL)
   ===================================== */
.info-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  background: linear-gradient(135deg, rgba(21, 27, 46, 0.95) 0%, rgba(15, 20, 36, 0.98) 100%);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 20px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  animation: slideDownFromTop 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-panel-center {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  flex: 1;
  justify-content: center;
}

@keyframes slideDownFromTop {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================================
   TIER BADGE (ЗНАЧКИ ТАРИФОВ)
   ===================================== */
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.tier-badge i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.tier-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tier-badge:hover::before {
  opacity: 1;
}

/* Free Tier Badge */
.tier-badge.free {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Premium Tier Badge */
.tier-badge.premium {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: premiumGlow 2s ease-in-out infinite;
}

@keyframes premiumGlow {
  0%, 100% {
    box-shadow:
      0 4px 12px rgba(240, 147, 251, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow:
      0 6px 20px rgba(240, 147, 251, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.3),
      0 0 30px rgba(240, 147, 251, 0.3);
  }
}

/* =====================================
   TIMER DISPLAY (ТАЙМЕР)
   ===================================== */
#timer-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
  flex-shrink: 0;
}

#timer-display i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Warning state (меньше 5 минут) */
#timer-display.timer-warning {
  color: #ffc107;
  background: rgba(255, 193, 7, 0.08);
  border-color: rgba(255, 193, 7, 0.2);
  box-shadow: 0 0 15px rgba(255, 193, 7, 0.15);
}

/* Critical state (меньше 2 минут) */
#timer-display.timer-critical {
  color: #f44336;
  background: rgba(244, 67, 54, 0.1);
  border-color: rgba(244, 67, 54, 0.3);
  animation: pulse 1s infinite;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(244, 67, 54, 0.2);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.2);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(244, 67, 54, 0.4);
  }
}

/* =====================================
   PARTICIPANTS DISPLAY
   ===================================== */
.participants-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
  flex-shrink: 0;
}

.participants-display i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* =====================================
   TIME WARNING BANNER
   ===================================== */
.time-warning-banner {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.95) 0%, rgba(255, 152, 0, 0.95) 100%);
  color: #000;
  padding: 16px 28px;
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(255, 193, 7, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90%;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.time-warning-banner.critical {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
  color: white;
  box-shadow:
    0 8px 32px rgba(244, 67, 54, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1), shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-50%) translateY(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(-50%) translateY(5px); }
}

.time-warning-banner .banner-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.time-warning-banner .banner-content {
  flex: 1;
}

.time-warning-banner .banner-content p {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
}

.time-warning-banner .banner-content p:first-child {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.time-warning-banner .banner-close {
  background: rgba(0, 0, 0, 0.2);
  border: none;
  color: inherit;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.time-warning-banner .banner-close:hover {
  background: rgba(0, 0, 0, 0.3);
  transform: scale(1.1);
}

/* =====================================
   UPGRADE MODAL (МОДАЛЬНЫЕ ОКНА)
   ===================================== */
.upgrade-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

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

/* Modal Overlay */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Modal Content */
.modal-content {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, rgba(21, 27, 46, 0.98) 0%, rgba(15, 20, 36, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 40px;
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow:
    0 20px 80px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  border-radius: 24px 24px 0 0;
}

.modal-content h2 {
  margin: 0 0 24px 0;
  font-size: 1.8rem;
  font-weight: 800;
  color: #f8fafc;
  text-align: center;
  letter-spacing: -0.5px;
}

.modal-body {
  margin-bottom: 32px;
  color: #94a3b8;
  line-height: 1.7;
}

.modal-body p {
  margin: 0 0 16px 0;
  font-size: 1.05rem;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-body strong {
  color: #f8fafc;
  font-weight: 700;
}

.modal-body ul {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.modal-body ul li {
  padding: 10px 0;
  padding-left: 32px;
  position: relative;
  font-size: 1.05rem;
}

.modal-body ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: 700;
  font-size: 1.3rem;
}

/* Modal Actions */
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =====================================
   UPGRADE BUTTONS
   ===================================== */

/* Small upgrade button in info panel */
.upgrade-btn-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow:
    0 2px 8px rgba(240, 147, 251, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}

.upgrade-btn-small i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.upgrade-btn-small::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.upgrade-btn-small:hover::before {
  width: 300px;
  height: 300px;
}

.upgrade-btn-small:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    0 6px 20px rgba(240, 147, 251, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.upgrade-btn-small:active {
  transform: scale(0.98);
}

/* Primary button in modals */
.btn-primary {
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow:
    0 6px 20px rgba(102, 126, 234, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.btn-primary:hover::before {
  width: 400px;
  height: 400px;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 10px 30px rgba(102, 126, 234, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Secondary button in modals */
.btn-secondary {
  padding: 16px 32px;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-secondary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.btn-secondary:hover::before {
  width: 400px;
  height: 400px;
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.btn-secondary:active {
  transform: scale(0.98);
}

/* =====================================
   TEXT VARIANTS (FULL/SHORT)
   ===================================== */

/* По умолчанию (desktop) - показываем полные версии */
.tier-short,
.timer-short,
.upgrade-short {
  display: none;
}

.tier-full,
.timer-full,
.participants-full,
.upgrade-full {
  display: inline;
}

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

@media (max-width: 768px) {
  /* На мобильных показываем короткие версии текста */
  .tier-short,
  .timer-short,
  .upgrade-short {
    display: inline;
  }

  .tier-full,
  .timer-full,
  .participants-full,
  .upgrade-full {
    display: none;
  }

  .info-panel {
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .time-warning-banner {
    top: 80px;
    padding: 14px 20px;
    max-width: calc(100% - 32px);
  }

  .time-warning-banner .banner-content p {
    font-size: 0.9rem;
  }

  .time-warning-banner .banner-content p:first-child {
    font-size: 1rem;
  }

  .modal-content {
    padding: 32px 24px;
    max-width: calc(100% - 32px);
  }

  .modal-content h2 {
    font-size: 1.5rem;
  }

  .modal-body p,
  .modal-body ul li {
    font-size: 1rem;
  }

  .btn-primary,
  .btn-secondary {
    padding: 14px 24px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .info-panel {
    padding: 6px 8px;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
  }

  .info-panel::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  .tier-badge {
    padding: 4px 8px;
    font-size: 0.7rem;
    gap: 4px;
  }

  .tier-badge i,
  #timer-display i,
  .participants-display i,
  .upgrade-btn-small i {
    width: 12px;
    height: 12px;
  }

  #timer-display,
  .participants-display {
    font-size: 0.7rem;
    padding: 4px 6px;
    gap: 4px;
  }

  .upgrade-btn-small {
    padding: 4px 8px;
    font-size: 0.65rem;
    gap: 4px;
  }

  .time-warning-banner {
    top: 70px;
    padding: 12px 16px;
    gap: 12px;
    max-width: calc(100% - 24px);
  }

  .time-warning-banner .banner-icon {
    font-size: 1.2rem;
  }

  .time-warning-banner .banner-content p {
    font-size: 0.85rem;
  }

  .time-warning-banner .banner-content p:first-child {
    font-size: 0.95rem;
    margin-bottom: 2px;
  }

  .modal-content {
    padding: 28px 20px;
    max-width: calc(100% - 24px);
    border-radius: 20px;
  }

  .modal-content h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
  }

  .modal-body {
    margin-bottom: 24px;
  }

  .modal-body p,
  .modal-body ul li {
    font-size: 0.95rem;
  }

  .modal-body ul li {
    padding: 8px 0 8px 28px;
  }

  .modal-body ul li::before {
    font-size: 1.1rem;
  }

  .btn-primary {
    padding: 14px 20px;
    font-size: 0.95rem;
  }

  .btn-secondary {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .modal-actions {
    gap: 10px;
  }
}

/* =====================================
   UTILITY CLASSES
   ===================================== */

.hidden {
  display: none !important;
}

.visible {
  display: block;
}

/* Smooth scrollbar for modal */
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(102, 126, 234, 0.5) 0%, rgba(118, 75, 162, 0.5) 100%);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}
