/* Digital Screen Client - Main Stylesheet */

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #000;
  color: #fff;
}

#app {
  width: 100%;
  height: 100%;
}

.screen-display {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
}

.content-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background-color: #000;
}

/* Content item containers */
.content-item {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
}

#image-container {
  background-color: #000;
}

#image-element {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  animation: fadeIn 0.5s ease-in-out;
}

#video-container {
  background-color: #000;
}

#video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000;
}

#text-container {
  background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
  padding: 60px;
  overflow-y: auto;
}

.text-content {
  font-size: 48px;
  line-height: 1.6;
  color: #fff;
  text-align: center;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: fadeIn 0.5s ease-in-out;
}

#pdf-container,
#html-container {
  background-color: #1a1a1a;
}

#pdf-viewer,
#html-viewer {
  width: 100%;
  height: 100%;
  border: none;
  background-color: #1a1a1a;
}

.provisioning-screen {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background:
    radial-gradient(circle at top, rgba(25, 118, 210, 0.22), transparent 35%),
    linear-gradient(160deg, #08111f 0%, #04070d 55%, #000 100%);
}

.provisioning-card {
  width: min(720px, 100%);
  padding: 40px;
  border-radius: 24px;
  background: rgba(6, 14, 27, 0.92);
  border: 1px solid rgba(84, 134, 196, 0.25);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.provisioning-label {
  display: inline-block;
  margin-bottom: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(25, 118, 210, 0.18);
  color: #8dbff5;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.provisioning-card h1 {
  margin-bottom: 14px;
  font-size: 42px;
  font-weight: 300;
  letter-spacing: 0.04em;
}

#provisioning-message-text {
  margin-bottom: 28px;
  color: #c5d0df;
  font-size: 18px;
  line-height: 1.6;
}

.provisioning-form {
  display: grid;
  gap: 18px;
}

.provisioning-field {
  display: grid;
  gap: 10px;
}

.provisioning-field span {
  color: #9fb4cd;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.provisioning-field input {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(137, 164, 196, 0.22);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 18px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.provisioning-field input:focus {
  border-color: rgba(76, 164, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.18);
}

.provisioning-help {
  color: #7f93ab;
  font-size: 14px;
  line-height: 1.5;
}

.provisioning-error {
  margin: 6px 0 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(244, 67, 54, 0.12);
  border: 1px solid rgba(244, 67, 54, 0.35);
  color: #ff8a80;
  font-size: 14px;
  line-height: 1.5;
}

#provisioning-pairing-code {
  font-family: "Courier New", monospace;
  font-size: 24px;
  letter-spacing: 6px;
  text-align: center;
  text-transform: uppercase;
}

.provisioning-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 10px;
}

.provisioning-actions button {
  border: none;
  border-radius: 14px;
  padding: 15px 22px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

#provisioning-save-button {
  background: linear-gradient(135deg, #1976d2 0%, #2c9aee 100%);
  color: #fff;
  box-shadow: 0 16px 35px rgba(25, 118, 210, 0.28);
}

#provisioning-clear-button {
  background: rgba(255, 255, 255, 0.08);
  color: #d7e2ef;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.provisioning-actions button:hover {
  transform: translateY(-1px);
}

.provisioning-actions button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

/* Loading indicator */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-in-out;
}

.spinner {
  width: 80px;
  height: 80px;
  border: 6px solid rgba(255, 255, 255, 0.1);
  border-top: 6px solid #1976d2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading p {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 2px;
}

/* Idle screen */
.idle-screen {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}

.idle-content {
  text-align: center;
  animation: fadeIn 0.5s ease-in-out;
}

.idle-logo {
  font-size: 120px;
  margin-bottom: 30px;
  animation: pulse 2s ease-in-out infinite;
}

.idle-content h1 {
  font-size: 48px;
  font-weight: 300;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.idle-content p {
  font-size: 24px;
  color: #999;
  font-weight: 300;
}

/* Error screen */
.error-screen {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3d1a1a 0%, #1a0a0a 100%);
}

.error-content {
  text-align: center;
  animation: fadeIn 0.5s ease-in-out;
}

.error-icon {
  font-size: 100px;
  margin-bottom: 30px;
}

.error-content h1 {
  font-size: 48px;
  font-weight: 300;
  margin-bottom: 20px;
  color: #ff6b6b;
  letter-spacing: 1px;
}

.error-content p {
  font-size: 20px;
  color: #ccc;
  font-weight: 300;
  max-width: 600px;
  word-wrap: break-word;
}

/* Offline badge */
.offline-badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #ff9800;
  color: white;
  padding: 12px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-in-out;
  z-index: 1001;
}

/* Device info (debug mode) */
.device-info {
  position: fixed;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #4caf50;
  padding: 8px 12px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  border: 1px solid rgba(76, 175, 80, 0.3);
  z-index: 1002;
  text-align: right;
}

.device-info small {
  display: block;
  line-height: 1.5;
}

.device-info span {
  color: #4caf50;
  font-weight: bold;
}

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

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

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

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Responsive styles */
@media (max-width: 1920px) {
  .text-content {
    font-size: 32px;
  }

  .idle-content h1 {
    font-size: 36px;
  }

  .idle-content p {
    font-size: 18px;
  }

  .error-content h1 {
    font-size: 36px;
  }

  .error-content p {
    font-size: 16px;
  }
}

@media (max-width: 1280px) {
  .text-content {
    font-size: 24px;
    padding: 40px;
  }

  .idle-logo {
    font-size: 80px;
  }

  .idle-content h1 {
    font-size: 28px;
  }

  .idle-content p {
    font-size: 16px;
  }

  .error-icon {
    font-size: 80px;
  }

  .error-content h1 {
    font-size: 28px;
  }

  .error-content p {
    font-size: 14px;
  }

  .provisioning-card {
    padding: 32px 28px;
  }

  .provisioning-card h1 {
    font-size: 34px;
  }

  #provisioning-message-text {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  .provisioning-screen {
    padding: 18px;
  }

  .provisioning-card {
    padding: 24px 20px;
    border-radius: 18px;
  }

  .provisioning-card h1 {
    font-size: 28px;
  }

  .provisioning-field input {
    font-size: 16px;
    padding: 14px 16px;
  }

  .provisioning-actions {
    flex-direction: column;
  }

  .provisioning-actions button {
    width: 100%;
  }
}

/* Dark mode (always on for this app) */
body {
  color-scheme: dark;
}

/* Print styles */
@media print {
  body {
    background-color: #fff;
  }

  .offline-badge,
  .device-info,
  .loading,
  #provisioning-overlay {
    display: none !important;
  }
}
