/* OxiCloud Inline Viewer Styles */

.inline-viewer-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.85);
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.inline-viewer-modal.active {
  display: flex !important;
  opacity: 1;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}

.inline-viewer-content {
  width: 90%;
  height: 90%;
  max-width: 1200px;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.inline-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e2e8f0;
}

.inline-viewer-title {
  font-size: 18px;
  font-weight: 500;
  color: #2d3748;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-viewer-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #718096;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.inline-viewer-close:hover {
  background-color: #e2e8f0;
  color: #4a5568;
}

.inline-viewer-container {
  flex-grow: 1;
  overflow: auto;
  background-color: #f0f3f7;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.inline-viewer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: #f8f9fa;
  border-top: 1px solid #e2e8f0;
}

.inline-viewer-download {
  background-color: #ff5e3a;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.inline-viewer-download:hover {
  background-color: #e74c3c;
}

.inline-viewer-controls {
  display: flex;
  gap: 8px;
}

.inline-viewer-controls button {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s;
}

.inline-viewer-controls button:hover {
  background-color: #e2e8f0;
  color: #334155;
}

/* Image viewer */
.inline-viewer-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center;
  transition: transform 0.2s ease;
}

/* PDF viewer */
.inline-viewer-pdf,
.inline-viewer-pdf-fallback {
  width: 100%;
  height: 100%;
  border: none;
}

/* Only show fallback if object fails */
.inline-viewer-pdf + .inline-viewer-pdf-fallback {
  display: none;
}

.inline-viewer-pdf:not([data]),
.inline-viewer-pdf[data=""] + .inline-viewer-pdf-fallback {
  display: block;
}

/* Loading indicator */
.inline-viewer-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 36px;
  color: #64748b;
}

/* Error and unsupported message */
.inline-viewer-message {
  padding: 32px;
  text-align: center;
  max-width: 400px;
}

.inline-viewer-icon {
  font-size: 64px;
  color: #cbd5e1;
  margin-bottom: 24px;
}

.inline-viewer-text {
  color: #64748b;
  line-height: 1.6;
}

.inline-viewer-text p {
  margin: 0 0 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .inline-viewer-content {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  
  .inline-viewer-controls {
    display: none;
  }
}