/* Scanner Page Styles */

.scanner-container {
  max-width: 900px;
  margin: 0 auto;
  min-height: 500px;
  position: relative;
}

.scanner-state {
  display: none;
  animation: fadeIn 0.3s ease-in;
}

.scanner-state.active {
  display: block;
}

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

/* Scanner Card */
.scanner-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.scanner-icon {
  color: var(--color-primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* Camera Preview */
.camera-preview-container {
  position: relative;
  background: #000;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#camera-preview {
  width: 100%;
  height: auto;
  min-height: 400px;
  max-height: 600px;
  object-fit: cover;
  display: block;
}

.camera-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.scan-frame {
  width: 300px;
  height: 400px;
  border: 3px solid var(--color-primary);
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  animation: scanPulse 2s infinite;
}

@keyframes scanPulse {
  0%, 100% {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5), 0 0 20px var(--color-primary);
  }
  50% {
    border-color: #fff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5), 0 0 30px var(--color-primary);
  }
}

.scan-instruction {
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border-radius: 20px;
  margin-top: 20px;
  font-weight: 500;
}

.camera-controls {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  z-index: 10;
}

.camera-controls .btn {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Result Card */
.result-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.result-header {
  text-align: center;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.book-result {
  animation: slideUp 0.5s ease-out;
}

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

.book-result img {
  transition: transform 0.3s ease;
}

.book-result img:hover {
  transform: scale(1.05);
}

/* Responsive */
@media (max-width: 768px) {
  .scanner-card {
    padding: 2rem 1rem;
  }

  .scan-frame {
    width: 250px;
    height: 350px;
  }

  .camera-controls {
    flex-direction: column;
    width: 90%;
  }

  .camera-controls .btn {
    width: 100%;
  }

  .result-card {
    padding: 1.5rem;
  }
}

/* Button Styles */
.btn-success {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #000;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-success:hover {
  background-color: #8bc34a;
  border-color: #8bc34a;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(167, 224, 120, 0.4);
}

.btn-outline-success {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-outline-success:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #000;
}

.btn-outline-light {
  border-color: var(--color-text);
  color: var(--color-text);
}

.btn-outline-light:hover {
  background-color: var(--color-text);
  color: var(--color-background);
}

/* Feature Icons */
.feature-icon {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.feature-icon:nth-child(2) {
  animation-delay: 0.5s;
}

.feature-icon:nth-child(3) {
  animation-delay: 1s;
}
