/* Base styles */
html {
  height: -webkit-fill-available;
}

body {
  background-color: #f8f9fa;
  min-height: 100vh;
  min-height: -webkit-fill-available; /* iOS viewport fix */
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem;
  touch-action: manipulation; /* Disable double-tap zoom */
}

/* Container styles */
.upload-container {
  position: relative;  /* Required for loading overlay positioning */
  max-width: 500px;
  width: 100%;
  margin: auto;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
}

/* Logo styles */
.logo {
  max-height: 60px;
  max-width: 100%;
  height: auto;
  margin-bottom: 1rem;
  object-fit: contain;
}

/* Loading overlay styles */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.spinner-border {
  width: 2rem !important;
  height: 2rem !important;
  margin-right: 8px;
}

/* Status message styles */
#status {
  transition: all 0.3s ease-in-out;
}

#status .alert {
  margin-bottom: 0.5rem;
}

.fade-message {
  transition: opacity 0.5s ease-in-out;
}

/* File list styles */
#fileList {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

#fileList .list-group-item {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Form input styles */
.form-control[type="file"] {
  padding: 0.75rem;
  min-height: 58px;
}

/* Token input styles */
#tokenInput {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 1.2rem;
  text-align: center;
  font-weight: bold;
}

/* Device info styles */
#deviceInfo {
  font-size: 0.9rem;
  padding: 0.5rem;
  margin-bottom: 1rem;
}

/* Touch interaction styles */
.btn, .form-control {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Mobile-specific styles */
@media (max-width: 576px) {
  .upload-container {
    padding: 15px;
  }

  h3 {
    font-size: 1.5rem;
  }

  .btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }

  #status {
    font-size: 0.9rem;
  }

  /* Improve touch targets on mobile */
  .btn-group {
    width: 100%;
    margin-bottom: 1rem;
  }

  .btn-group .btn {
    flex: 1;
    padding: 0.75rem;
  }
}

/* Alert enhancements */
.alert {
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.alert-success {
  border-left: 4px solid #198754;
}

.alert-danger {
  border-left: 4px solid #dc3545;
}

/* Loading overlay content styles */
.loading-overlay .text-center {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Upload button enhancements */
#uploadBtn:not(:disabled) {
  transition: transform 0.2s ease;
}

#uploadBtn:not(:disabled):hover {
  transform: translateY(-1px);
}

/* File list animations */
.list-group-item {
  transition: background-color 0.2s ease;
}

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