/**
 * PWA Installation UI Styles for KNIRVCONTROLLER
 */

/* Install Banner */
.install-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #1e40af 0%, #2b56f5 100%);
  color: white;
  padding: 12px 16px;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: slideDown 0.3s ease-out;
}

.install-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.install-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.install-banner-text strong {
  font-size: 14px;
  font-weight: 600;
}

.install-banner-text span {
  font-size: 12px;
  opacity: 0.9;
}

.install-banner-actions {
  display: flex;
  gap: 8px;
}

.install-banner .btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.install-banner .btn-primary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.install-banner .btn-primary:hover {
  background: rgba(255, 255, 255, 0.3);
}

.install-banner .btn-outline-secondary {
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.install-banner .btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 1.75rem auto;
  max-width: 500px;
  pointer-events: none;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  color: white;
  margin: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #333;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #2b56f5;
}

.btn-close {
  background: none;
  border: none;
  color: #999;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  color: white;
}

.btn-close::before {
  content: '×';
}

.modal-body {
  padding: 20px 24px 24px;
}

/* Installation Instructions */
.install-instructions {
  margin-bottom: 20px;
}

.install-instructions.ios .step {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(43, 86, 245, 0.1);
  border-radius: 8px;
  border-left: 3px solid #2b56f5;
}

.step-number {
  background: #2b56f5;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  margin-right: 16px;
  flex-shrink: 0;
}

.step-content h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.step-content p {
  margin: 0;
  font-size: 13px;
  color: #ccc;
  line-height: 1.4;
}

.share-icon {
  background: #007AFF;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

/* Install Actions */
.install-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.install-actions .btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.install-actions .btn-primary {
  background: linear-gradient(135deg, #1e40af 0%, #2b56f5 100%);
  color: white;
}

.install-actions .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(43, 86, 245, 0.3);
}

/* Success Message */
.success-message {
  text-align: center;
  padding: 20px 0;
}

.success-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.success-message h3 {
  margin: 0 0 12px 0;
  color: #2b56f5;
  font-size: 20px;
}

.success-message p {
  margin: 0 0 24px 0;
  color: #ccc;
  line-height: 1.5;
}

.success-actions {
  display: flex;
  justify-content: center;
}

/* Welcome Screen */
.welcome-screen {
  text-align: center;
  padding: 20px 0;
}

.welcome-logo {
  margin-bottom: 20px;
}

.welcome-screen h3 {
  margin: 0 0 12px 0;
  color: #2b56f5;
  font-size: 22px;
}

.welcome-screen p {
  margin: 0 0 24px 0;
  color: #ccc;
  line-height: 1.5;
}

.welcome-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.feature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: rgba(43, 86, 245, 0.1);
  border-radius: 8px;
  color: #ccc;
}

.feature-icon {
  font-size: 20px;
}

.welcome-actions {
  display: flex;
  justify-content: center;
}

/* Platform Warning */
.platform-warning {
  text-align: center;
  padding: 20px 0;
}

.platform-warning p {
  margin: 0 0 16px 0;
  color: #ccc;
  line-height: 1.5;
}

.platform-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Already Installed */
.already-installed {
  text-align: center;
  padding: 20px 0;
}

.already-installed .success-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.already-installed p {
  margin: 0 0 24px 0;
  color: #ccc;
  line-height: 1.5;
}

.installed-actions {
  display: flex;
  justify-content: center;
}

/* Animations */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-content {
  animation: fadeIn 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
  .install-banner-content {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .install-banner-actions {
    justify-content: center;
  }
  
  .modal-dialog {
    margin: 1rem;
  }
  
  .modal-content {
    margin: 0;
  }
  
  .welcome-features {
    gap: 8px;
  }
  
  .feature {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  
  .platform-actions,
  .install-actions {
    flex-direction: column;
  }
  
  .install-actions .btn {
    width: 100%;
  }
}

/* Dark theme adjustments */
@media (prefers-color-scheme: dark) {
  .modal-content {
    background: #0f0f0f;
    border-color: #222;
  }
  
  .modal-header {
    border-bottom-color: #222;
  }
  
  .step-content p,
  .success-message p,
  .welcome-screen p,
  .platform-warning p,
  .already-installed p {
    color: #aaa;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .install-banner {
    background: #000;
    border-bottom: 2px solid #fff;
  }
  
  .modal-content {
    background: #000;
    border: 2px solid #fff;
  }
  
  .btn-primary {
    background: #fff !important;
    color: #000 !important;
  }
}
