/* Variables */
:root {
  --dark-bg: #000000;
  --darker-purple: #2d1b4e;
  --dark-purple: #4a2376;
  --main-purple: #6a3de8;
  --light-purple: #9d71f7;
  --accent-purple: #b892ff;
  --text-light: #f8f7ff;
  --text-muted: #a8a8b3;
  --gradient: linear-gradient(135deg, var(--dark-purple), var(--main-purple));
  --circle-size: 300px;
  --apple-glow-color1: rgba(143, 61, 209, 0.6);
  --apple-glow-color2: rgba(97, 59, 201, 0.6);
  --apple-glow-color3: rgba(72, 14, 138, 0.4);
}

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

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--dark-bg);
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* Diamond decoration */
.diamond-decoration {
  position: fixed;
  bottom: -35%;
  right: -20%;
  width: 50%;
  height: auto;
  z-index: -1;
  opacity: 0.6;
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header Styles */
header {
  margin-bottom: 1rem;
  animation: fadeIn 1s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.logo-container {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  justify-content: center;
}

.small-icon {
  height: 28px;
  width: auto;
  margin-right: 10px;
}

.text-logo {
  height: 30px;
  width: auto;
}

.tagline {
  color: var(--text-light);
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 0.3rem;
  align-self: center;
}

/* Main Content Styles */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.upload-container {
  width: 100%;
  max-width: 600px;
  text-align: center;
  animation: slideUp 0.8s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.upload-area {
  border: 2px dashed var(--light-purple);
  border-radius: 50%;
  width: var(--circle-size);
  height: var(--circle-size);
  margin-bottom: 2rem;
  background-color: rgba(74, 35, 118, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.upload-area:hover {
  border-color: var(--main-purple);
  background-color: rgba(74, 35, 118, 0.2);
}

.upload-area i {
  font-size: 3.5rem;
  color: var(--light-purple);
  margin-bottom: 1.5rem;
}

.upload-area h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--accent-purple);
}

.upload-area p {
  color: var(--text-muted);
  font-size: 1rem;
  text-align: center;
}

.file-info {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Footer Styles */
footer {
  text-align: center;
  padding-top: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  opacity: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* For drag and drop visual feedback */
.drag-active {
  border-color: var(--main-purple);
  background-color: rgba(74, 35, 118, 0.3);
  box-shadow: 0 0 30px rgba(106, 61, 232, 0.3);
}

/* Success animation */
.success {
  animation: pulse 1.5s ease;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(157, 113, 247, 0.7);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(157, 113, 247, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(157, 113, 247, 0);
  }
}

/* File details styling */
.file-details {
  background-color: rgba(74, 35, 118, 0.15);
  border-radius: 10px;
  padding: 1.2rem;
  margin-top: 1rem;
  text-align: left;
  border-left: 3px solid var(--light-purple);
}

.file-details p {
  margin: 0.5rem 0;
}

.upload-status {
  margin-top: 1rem !important;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(157, 113, 247, 0.3);
  font-weight: 600;
  color: var(--accent-purple);
}

/* Upload animation */
.uploading {
  position: relative;
  border-color: var(--main-purple);
  transition: all 0.5s ease;
  z-index: 10;
}

/* Spinning border animation */
.uploading::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border: 3px solid transparent;
  border-top-color: var(--accent-purple);
  border-left-color: var(--light-purple);
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
}

.uploading i,
.uploading h2,
.uploading p {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  transition: all 0.3s ease;
}

.upload-complete {
  border-color: var(--accent-purple);
  background-color: rgba(74, 35, 118, 0.3);
  animation: completePulse 1s ease-out;
}

.upload-complete i {
  color: var(--accent-purple);
  transform: scale(1.1);
  transition: all 0.3s ease;
}

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

  100% {
    transform: rotate(360deg);
  }
}

.progress-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.progress-circle {
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.3s ease;
}

/* Create a new overlay that covers everything except the circle */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0);
  z-index: 1;
  pointer-events: none;
  transition: background-color 0.5s ease;
}

body.uploading-active::after {
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 5;
}

/* Apple Intelligence-like animation */
.upload-area.uploading {
  border-color: var(--main-purple);
  background-color: rgba(74, 35, 118, 0.3);
  box-shadow: 0 0 80px 5px var(--apple-glow-color3);
  animation: applePulsate 2.5s infinite alternate;
}

.apple-glow {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: scale(0);
  z-index: -1;
}

.apple-glow-inner {
  position: absolute;
  width: calc(var(--circle-size) * 1);
  height: calc(var(--circle-size) * 1);
  border-radius: 50%;
  background: radial-gradient(circle, var(--apple-glow-color1), transparent 70%);
  animation: appleGlowInner 4s infinite alternate;
}

@keyframes applePulsate {
  0% {
    box-shadow: 0 0 20px 2px var(--apple-glow-color3);
  }

  50% {
    box-shadow: 0 0 40px 10px var(--apple-glow-color2);
  }

  100% {
    box-shadow: 0 0 30px 5px var(--apple-glow-color1);
  }
}

@keyframes appleGlowInner {
  0% {
    opacity: 0.4;
    transform: scale(0.6);
  }

  50% {
    opacity: 0.99;
    transform: scale(1);
  }

  100% {
    opacity: 0.4;
    transform: scale(0.6);
  }
}

@keyframes glowPulse {
  0% {
    filter: drop-shadow(0 0 5px var(--apple-glow-color3));
  }

  50% {
    filter: drop-shadow(0 0 15px var(--apple-glow-color2));
  }

  100% {
    filter: drop-shadow(0 0 8px var(--apple-glow-color1));
  }
}

/* Responsive design */
@media (max-width: 768px) {
  :root {
    --circle-size: 250px;
  }

  .small-icon {
    height: 30px;
  }

  .text-logo {
    height: 24px;
  }

  .tagline {
    font-size: 1.2rem;
    text-align: center;
  }

  .upload-area {
    padding: 1.5rem;
  }

  .upload-area i {
    font-size: 2.5rem;
  }

  .upload-area h2 {
    font-size: 1.2rem;
  }

  header {
    margin-bottom: 1rem;
  }

  .diamond-decoration {
    bottom: -15%;
    right: -35%;
    width: 85%;
    opacity: 0.7;
  }

  .logo-container {
    margin-bottom: 0.5rem;
  }

  .container {
    padding: 1.5rem;
  }
}

/* Add blur effect to the upload container during upload */
.uploading-active .upload-container {
  position: relative;
}

.uploading-active .upload-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background-color: transparent;
  z-index: -2;
  pointer-events: none;
  opacity: 0.2;
  border-radius: 50%;
}

.progress-indicator.glowing::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
      var(--apple-glow-color1) 0%,
      var(--apple-glow-color2) 50%,
      var(--apple-glow-color3) 100%);
  animation: rotateHalo 3s linear infinite;
  filter: blur(20px);
  opacity: 0.5;
}

@keyframes rotateHalo {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Classification Results Styling */
.result-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
  background: rgba(15, 15, 20, 0.85);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2),
    0 0 40px rgba(106, 61, 232, 0.15),
    0 0 80px rgba(106, 61, 232, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(106, 61, 232, 0.2);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-status-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.result-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0;
}

.result-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
}

.result-gauge {
  width: 100%;
  max-width: 300px;
  display: flex;
  justify-content: center;
  position: relative;
}

.gauge-fill {
  transition: stroke-dashoffset 2s ease-in-out;
}

.gauge-needle {
  filter: drop-shadow(0 0 5px white);
}

.result-description {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-light);
  max-width: 450px;
}

/* Try Again Button Styling */
.try-again-button {
  background-color: #664a9e;
  /* Darker purple */
  color: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(102, 74, 158, 0.25);
  transition: all 0.3s ease;
  margin-top: 20px;
}

.try-again-button:hover {
  background-color: #563c89;
  /* Even darker on hover */
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(102, 74, 158, 0.3);
}

.try-again-button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 3px rgba(102, 74, 158, 0.2);
  background-color: #4a3377;
  /* Darkest when pressed */
  animation: buttonPress 0.3s ease;
}

@keyframes buttonPress {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.95);
  }

  100% {
    transform: scale(1);
  }
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.result-button {
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  border: none;
}

.primary-button {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(106, 61, 232, 0.4);
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(106, 61, 232, 0.6);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Animation classes */
.fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

.fade-in-up-delay {
  animation: fadeInUp 0.8s 0.3s ease forwards;
  opacity: 0;
}

.fade-in-up-delay-more {
  animation: fadeInUp 0.8s 0.6s ease forwards;
  opacity: 0;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments for result view */
@media (max-width: 768px) {
  .result-container {
    padding: 1.5rem;
  }

  .result-title {
    font-size: 1.2rem;
  }

  .result-actions {
    flex-direction: column;
    width: 100%;
  }

  .result-button {
    width: 100%;
  }

  .result-description {
    font-size: 1rem;
  }

  .result-body {
    gap: 1rem;
  }

  .try-again-button {
    margin-top: 10px;
  }
}

/* QR Code Styling */
.qr-code-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0rem;
  width: 100%;
}

.qr-code-wrapper {
  transition: all 0.5s ease;
  overflow: hidden;
}

#qrcode {
  width: 150px;
  height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.qr-code-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
  transform: scale(0);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.8s ease;
}

.qr-code-svg.qr-reveal {
  transform: scale(1);
  opacity: 1;
}

.qr-code-svg.qr-pulse {
  animation: qrPulse 2s ease-in-out infinite;
}

@keyframes qrPulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
  }

  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 8px 15px rgba(106, 61, 232, 0.4));
  }

  100% {
    transform: scale(1);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
  }
}

#qrcode::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  background: linear-gradient(to bottom,
      rgba(106, 61, 232, 0.8),
      transparent);
  opacity: 0;
  animation: qrScanEffect 2.5s 1s infinite;
  pointer-events: none;
  z-index: 2;
}

.qr-code-caption {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.qr-code-caption i {
  margin-right: 5px;
  color: var(--light-purple);
}

.qr-code-wrapper:hover+.qr-code-caption {
  opacity: 1;
  color: var(--accent-purple);
}

.qr-code-wrapper:hover+.qr-code-caption i {
  animation: iconPulse 0.6s infinite alternate;
}

@keyframes iconPulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.2);
  }
}

/* QR code animation */
@keyframes qrScanEffect {
  0% {
    opacity: 0;
    height: 0;
    top: 0;
  }

  50% {
    opacity: 0.8;
  }

  100% {
    opacity: 0;
    height: 100%;
    top: 100%;
  }
}

.qr-code-wrapper::after {
  content: none;
}

/* Make QR code responsive */
@media (max-width: 768px) {
  #qrcode {
    width: 120px;
    height: 120px;
  }

  .qr-code-wrapper {
    padding: 10px;
  }

  .qr-code-caption {
    font-size: 0.8rem;
    margin-top: 0px;
  }
}

.result-subtitle {
  font-size: 1rem;
  color: #666;
  margin-top: 0;
  margin-bottom: 1rem;
  opacity: 0.8;
  font-weight: 400;
}

/* Добавьте в ваш CSS файл */
body {
  /* Устанавливаем черный цвет для системной шапки на Android */
  --pwa-status-bar-color: black;
}

@media all and (display-mode: standalone) {
  /* Стили только для режима PWA */
  body {
    padding-top: env(safe-area-inset-top);
    background-color: #000000;
  }
}