/**
 * Стили для калькулятора арканов
 */

/* Основные стили */
:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  --dark-color: #1f2937;
  --light-color: #f3f4f6;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding-bottom: 80px;
}

/* Навигация */
.navbar {
  box-shadow: var(--shadow);
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.25rem;
}

.navbar-brand i {
  color: #fbbf24;
}

/* Карточки */
.card {
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.card.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.card.shadow-sm {
  box-shadow: var(--shadow);
}

/* Форма */
.form-control {
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 0.625rem 1.5rem;
  transition: all 0.3s ease;
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1.125rem;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Матрица - визуализация */
.matrix-container {
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
}

.matrix-grid {
  max-width: 900px;
  margin: 0 auto;
}

.circle {
  padding: 20px;
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow);
}

.inner-circle {
  border: 3px solid var(--primary-color);
}

.outer-circle {
  border: 3px solid var(--warning-color);
}

/* Позиция в матрице */
.position-badge {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  overflow: hidden;
}

.position-badge:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.position-badge.reversed {
  border-color: var(--danger-color);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.position-number {
  position: absolute;
  top: 5px;
  left: 5px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.arcana-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.reversed-indicator {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 1.25rem;
}

/* Номер аркана в карточке */
.arcana-number {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  border: 5px solid white;
}

/* Карточки арканов */
.arcana-card {
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.arcana-card .card-header {
  border-radius: 12px 12px 0 0 !important;
}

/* Бейджи */
.badge {
  padding: 0.375rem 0.75rem;
  font-weight: 500;
  border-radius: 6px;
}

/* Алерты */
.alert {
  border-radius: 8px;
  border: none;
  box-shadow: var(--shadow);
}

.alert-success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
}

.alert-danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

.alert-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

.alert-info {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
}

/* Табы */
.nav-tabs {
  border-bottom: 2px solid #e5e7eb;
}

.nav-tabs .nav-link {
  border: none;
  color: #6b7280;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.05);
  border-radius: 8px 8px 0 0;
}

.nav-tabs .nav-link.active {
  color: var(--primary-color);
  background: white;
  border-bottom: 3px solid var(--primary-color);
  font-weight: 600;
}

/* Футер */
footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Спиннер загрузки */
.spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.3em;
}

/* Информационные карточки на главной */
.card h-100 {
  height: 100%;
}

.card-body.text-center i {
  display: block;
  margin-bottom: 1rem;
}

/* Анимации */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Адаптивность */
@media (max-width: 768px) {
  .position-badge {
    width: 80px;
    height: 80px;
  }
  
  .arcana-value {
    font-size: 1.5rem;
  }
  
  .arcana-number {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
  }
  
  .display-4 {
    font-size: 2rem;
  }
  
  .display-5 {
    font-size: 1.75rem;
  }
  
  .card-body {
    padding: 1rem !important;
  }
}

@media (max-width: 576px) {
  .position-badge {
    width: 70px;
    height: 70px;
  }
  
  .arcana-value {
    font-size: 1.25rem;
  }
  
  .position-number {
    width: 20px;
    height: 20px;
    font-size: 0.625rem;
  }
}

/* Печать */
@media print {
  body {
    background: white;
  }
  
  .navbar,
  footer,
  .btn,
  .d-print-none {
    display: none !important;
  }
  
  .card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #e5e7eb;
  }
  
  .container {
    max-width: 100%;
  }
}

/* Дополнительные эффекты */
.glow {
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Градиентные заголовки */
.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Улучшение читаемости */
p, li {
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Список групп */
.list-group-item {
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin-bottom: 0.5rem;
}

.list-group-item:hover {
  background: #f9fafb;
}

/* Скроллбар (для WebKit браузеров) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
}

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

#portraitCalcBtn {
  position: relative;
  top: 3px;
}