/* Copyright (c) Microsoft Corporation.
 Licensed under the MIT License. */

body,
html {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #323639; /* Match PDF viewer background to prevent flash */
}

.header {
  background: #2c3e50;
  color: white;
  padding: 12px 20px;
  display: none; /* Start hidden to prevent flash during PDF load */
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  position: relative;
}

.header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  background: #3498db;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s;
}

.btn:hover {
  background: #2980b9;
}

.btn-secondary {
  background: #95a5a6;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh; /* Start with full height, will be adjusted when header shows */
  background: #323639; /* Match PDF viewer background */
  color: white; /* Adjust text color for dark background */
  opacity: 0; /* Start transparent for delayed loading */
  transition: opacity 0.3s ease-in-out; /* Smooth fade-in transition */
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1); /* Subtle border for dark background */
  border-top: 4px solid #8ab4f8; /* Light blue accent */
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

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

.loading-text {
  color: #e8eaed; /* Light text for dark background */
  font-size: 16px;
  margin-bottom: 10px;
}

.loading-subtitle {
  color: #9aa0a6; /* Dimmer text for subtitle */
  font-size: 14px;
}

.error-container {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh; /* Start with full height, will be adjusted when header shows */
  background: white;
  padding: 40px;
  text-align: center;
}

.error-icon {
  font-size: 48px;
  color: #e74c3c;
  margin-bottom: 20px;
}

.error-title {
  color: #2c3e50;
  font-size: 24px;
  margin-bottom: 16px;
  font-weight: 500;
}

.error-message {
  color: #7f8c8d;
  font-size: 16px;
  margin-bottom: 30px;
  line-height: 1.5;
  max-width: 500px;
}

.error-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.pdf-url {
  background: #ecf0f1;
  padding: 10px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  color: #2c3e50;
  margin: 20px 0;
  word-break: break-all;
  max-width: 600px;
}

#pdfFrame {
  width: 100%;
  height: calc(100vh - 60px);
  border: none;
  background: #323639; /* Match PDF viewer background */
  display: none;
}

.url-info {
  font-size: 12px;
  color: #bdc3c7;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 300px;
}

@media (max-width: 768px) {
  .header {
    padding: 10px 15px;
    flex-direction: column;
    gap: 10px;
  }

  .header h1 {
    font-size: 16px;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: center;
  }

  .btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .url-info {
    max-width: 200px;
  }
}
