/* PWA-specific styles for Cubiio Studio */

/* Global styles */
html, body, #root {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

#root {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Installation Banner */
.install-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.install-content {
  display: flex;
  align-items: center;
  flex: 1;
}

.install-logo {
  width: 48px;
  height: 48px;
  margin-right: 16px;
}

.install-text {
  flex: 1;
}

.install-text h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
  color: #333333;
}

.install-text p {
  margin: 0;
  font-size: 14px;
  color: #7f8c8d;
}

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

.primary-button {
  background: #e67e22;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s ease;
}

.primary-button:hover {
  background: #d35400;
}

.secondary-button {
  background: transparent;
  color: #e67e22;
  border: 1px solid #e67e22;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
}

.secondary-button:hover {
  background: rgba(230, 126, 34, 0.1);
}

.close-button {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 0 8px;
  color: #7f8c8d;
  transition: color 0.2s ease;
}

.close-button:hover {
  color: #333333;
}

/* Update Banners */
.update-banner {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 16px;
  z-index: 1000;
}

.update-banner.major {
  width: 320px;
}

.update-banner.minor {
  padding: 12px 20px;
  background: rgba(230, 126, 34, 0.95);
}

.update-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.update-text h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
  color: #333333;
}

.update-text p {
  margin: 0;
  font-size: 14px;
  color: #7f8c8d;
}

.update-banner.minor .update-text p {
  color: white;
  font-weight: 500;
}

.update-banner.minor .close-button {
  color: white;
}

.update-banner.minor .close-button:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Version Info in Update Banners */
.version-info {
  margin-top: 4px;
}

.version-info small {
  color: #95a5a6;
  font-size: 12px;
}

.update-banner.minor .version-info small {
  color: rgba(255, 255, 255, 0.8);
}

/* Version Indicator */
.version-indicator {
  position: fixed;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.6);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  z-index: 100;
  pointer-events: none;
  user-select: none;
}

/* Offline Indicator */
.offline-indicator {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background: #e74c3c;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: bold;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Success Toast */
.success-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #2ecc71;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

/* Fallback Icons */
.fallback-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
}

.fallback-icon svg {
  width: 100%;
  height: 100%;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .update-banner.major {
    width: calc(100vw - 40px);
    left: 20px;
    right: 20px;
  }
  
  .install-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .install-content {
    margin-bottom: 12px;
  }
  
  .install-buttons {
    width: 100%;
    justify-content: flex-end;
  }
}
