/**
 * Asset Viewer Styles
 * VS Code/Cline-inspired dark theme for asset previews
 */

/* Container */
#assetViewerContainer {
  width: 100%;
  height: 100%;
  background-color: var(--bs-dark);
  color: var(--bs-light);
  overflow: hidden;
}

.asset-viewer-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #1e1e1e;
  color: #cccccc;
}

/* Asset Viewer Content */
.asset-viewer-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

/* Header */
.asset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background-color: #252526;
  border-bottom: 1px solid #3c3c3c;
  flex-shrink: 0;
}

.asset-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.asset-info i {
  font-size: 18px;
}

.asset-name {
  font-weight: 600;
  color: #ffffff;
}

.asset-meta {
  color: #999999;
  font-size: 13px;
}

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

.asset-actions .btn {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 4px;
  transition: all 0.2s;
}

.asset-actions .btn:hover {
  background-color: #37373d;
}

.asset-actions .btn-outline-secondary {
  color: #cccccc;
  border-color: #3c3c3c;
}

.asset-actions .btn-outline-secondary:hover {
  background-color: #37373d;
  border-color: #3c3c3c;
  color: #ffffff;
}

.asset-actions .btn-outline-primary {
  color: #4fc3f7;
  border-color: #4fc3f7;
}

.asset-actions .btn-outline-primary:hover {
  background-color: rgba(79, 195, 247, 0.1);
  border-color: #4fc3f7;
  color: #4fc3f7;
}

/* Body */
.asset-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background-color: #1e1e1e;
  padding: 20px;
}

/* Image Container */
.image-container {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
  cursor: zoom-in;
  image-rendering: -webkit-optimize-contrast;
}

/* Video Container */
.video-container {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-container video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Audio Body */
.audio-body {
  background: linear-gradient(135deg, #1e1e1e 0%, #2d2d30 100%);
}

.audio-container {
  text-align: center;
  max-width: 600px;
  width: 100%;
}

.audio-icon {
  color: #4fc3f7;
  opacity: 0.6;
}

.audio-container h5 {
  color: #ffffff;
  font-weight: 500;
  margin-bottom: 2rem;
}

.audio-container audio {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Font Body */
.font-body {
  background: linear-gradient(135deg, #1e1e1e 0%, #2d2d30 100%);
  padding: 40px;
}

.font-preview {
  max-width: 900px;
  margin: 0 auto;
  background-color: #252526;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.font-sample {
  color: #ffffff;
  line-height: 1.4;
  border-bottom: 1px solid #3c3c3c;
  padding-bottom: 20px;
}

.font-sample:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* PDF Viewer */
.pdf-viewer {
  width: 100%;
  height: 100%;
  min-height: 600px;
  border: none;
  background-color: #2d2d30;
}

/* Loading State */
.asset-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #cccccc;
}

.asset-loading .spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Error State */
.asset-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px;
}

.asset-error i {
  margin-bottom: 20px;
}

.asset-error h5 {
  color: #ffffff;
  margin-bottom: 12px;
  font-weight: 500;
}

.asset-error .text-muted {
  color: #999999 !important;
  margin-bottom: 8px;
}

.asset-error .text-danger {
  color: #f48771 !important;
  font-size: 14px;
}

.asset-error .btn-primary {
  background-color: #4fc3f7;
  border-color: #4fc3f7;
  margin-top: 20px;
}

.asset-error .btn-primary:hover {
  background-color: #29b6f6;
  border-color: #29b6f6;
}

/* Zoom Controls */
#zoomLevel {
  min-width: 50px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .asset-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }

  .asset-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .font-preview {
    padding: 20px;
  }

  .font-sample {
    font-size: 80% !important;
  }
}

/* Light Theme Support */
[data-theme="light"] #assetViewerContainer,
[data-theme="light"] .asset-viewer-container {
  background-color: #ffffff;
  color: #333333;
}

[data-theme="light"] .asset-header {
  background-color: #f3f3f3;
  border-bottom-color: #e0e0e0;
}

[data-theme="light"] .asset-name {
  color: #000000;
}

[data-theme="light"] .asset-meta {
  color: #666666;
}

[data-theme="light"] .asset-actions .btn-outline-secondary {
  color: #333333;
  border-color: #d0d0d0;
}

[data-theme="light"] .asset-actions .btn-outline-secondary:hover {
  background-color: #e8e8e8;
  border-color: #d0d0d0;
  color: #000000;
}

[data-theme="light"] .asset-body {
  background-color: #ffffff;
}

[data-theme="light"] .audio-body,
[data-theme="light"] .font-body {
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

[data-theme="light"] .font-preview {
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .font-sample {
  color: #000000;
  border-bottom-color: #e0e0e0;
}

[data-theme="light"] .audio-container h5,
[data-theme="light"] .asset-error h5 {
  color: #000000;
}

[data-theme="light"] .pdf-viewer {
  background-color: #f5f5f5;
}

[data-theme="light"] .asset-loading {
  color: #333333;
}

/* Dark Theme Support */
body[data-theme="dark"] #assetViewerContainer,
body[data-theme="dark"] .asset-viewer-container {
  background-color: var(--bg-primary);
  color: var(--text-secondary);
}

body[data-theme="dark"] .asset-header {
  background-color: var(--bg-secondary);
  border-bottom-color: var(--border);
}

body[data-theme="dark"] .asset-name {
  color: var(--text-primary);
}

body[data-theme="dark"] .asset-meta {
  color: var(--text-muted);
}

body[data-theme="dark"] .asset-actions .btn-outline-secondary {
  color: var(--text-secondary);
  border-color: var(--border);
}

body[data-theme="dark"] .asset-actions .btn-outline-secondary:hover {
  background-color: var(--hover-bg);
  border-color: var(--border);
  color: var(--text-primary);
}

body[data-theme="dark"] .asset-body {
  background-color: var(--bg-primary);
}

body[data-theme="dark"] .audio-body,
body[data-theme="dark"] .font-body {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

body[data-theme="dark"] .font-preview {
  background-color: var(--bg-secondary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .font-sample {
  color: var(--text-primary);
  border-bottom-color: var(--border);
}

body[data-theme="dark"] .audio-container h5,
body[data-theme="dark"] .asset-error h5 {
  color: var(--text-primary);
}

body[data-theme="dark"] .pdf-viewer {
  background-color: var(--bg-secondary);
}

body[data-theme="dark"] .asset-loading {
  color: var(--text-secondary);
}

body[data-theme="dark"] .asset-error .text-muted {
  color: var(--text-muted) !important;
}

/* Smooth transitions */
.asset-viewer-container,
.asset-header,
.asset-body {
  transition: background-color 0.3s ease, color 0.3s ease;
}
