/* archive-viewer.css - Styles for archive viewing components */

/* Archive Card Styles */
.archive-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s;
  margin-bottom: 15px;
}

.archive-card:hover {
  border-color: #667eea;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.archive-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.archive-mode {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mode-forensic {
  background: #fee2e2;
  color: #dc2626;
}

.mode-verified {
  background: #dcfce7;
  color: #16a34a;
}

.mode-personal {
  background: #e0e7ff;
  color: #4f46e5;
}

.archive-badges {
  display: flex;
  gap: 8px;
}

.archive-badges span {
  font-size: 16px;
  cursor: help;
}

.badge-ots { filter: hue-rotate(30deg); }
.badge-media { filter: hue-rotate(-30deg); }
.badge-blossom { filter: hue-rotate(60deg); }

.archive-card-content {
  margin-bottom: 15px;
}

.archive-url {
  margin-bottom: 10px;
}

.url-link {
  color: #3b82f6;
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  word-break: break-all;
}

.url-link:hover {
  text-decoration: underline;
}

.external-link {
  opacity: 0.5;
  font-size: 12px;
}

.archive-meta {
  display: flex;
  gap: 15px;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 10px;
}

.archive-verification {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.archive-verification.verified_match {
  background: #dcfce7;
  color: #16a34a;
}

.archive-verification.manipulation_detected {
  background: #fee2e2;
  color: #dc2626;
}

.archive-verification.expected_mismatch {
  background: #e0e7ff;
  color: #4f46e5;
}

.archive-verification.cors_limited {
  background: #f1f5f9;
  color: #64748b;
}

.archive-description {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Action Buttons */
.archive-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 6px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.action-btn:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  transform: translateY(-1px);
}

.btn-icon {
  font-size: 14px;
}

.btn-text {
  font-weight: 500;
}

/* Viewer Modal */
.archive-viewer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

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

.viewer-container {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 1400px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

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

.viewer-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 20px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.viewer-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.viewer-url {
  font-weight: 500;
}

.viewer-date {
  opacity: 0.9;
  font-size: 14px;
}

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

.viewer-control {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s;
}

.viewer-control:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.viewer-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #f8fafc;
}

.viewer-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #64748b;
}

.archive-viewer-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

.viewer-footer {
  background: #f8fafc;
  padding: 15px 20px;
  border-top: 1px solid #e2e8f0;
  border-radius: 0 0 12px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.viewer-verification {
  font-size: 14px;
  color: #475569;
}

.viewer-actions {
  display: flex;
  gap: 15px;
}

.viewer-action {
  color: #667eea;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.viewer-action:hover {
  text-decoration: underline;
}

/* Fullscreen mode */
.archive-viewer-modal.fullscreen .viewer-container {
  max-width: 100%;
  width: 100%;
  height: 100vh;
  border-radius: 0;
}

/* Source Viewer Modal */
.source-viewer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.source-container {
  background: #1e293b;
  border-radius: 12px;
  width: 100%;
  max-width: 1200px;
  height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.source-header {
  background: #0f172a;
  color: white;
  padding: 15px 20px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.source-header h3 {
  margin: 0;
  font-size: 16px;
}

.source-controls {
  display: flex;
  gap: 10px;
}

.source-controls button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.source-controls button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.source-content {
  flex: 1;
  overflow: auto;
  padding: 20px;
  background: #1e293b;
  color: #e2e8f0;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
}

.source-content .tag {
  color: #60a5fa;
}

.source-content .attr {
  color: #fbbf24;
}

.source-content .value {
  color: #4ade80;
}

/* Details Modal */
.details-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.details-container {
  background: white;
  border-radius: 12px;
  padding: 30px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e2e8f0;
}

.details-header h2 {
  margin: 0;
  color: #1e293b;
  font-size: 24px;
}

.details-close {
  background: #ef4444;
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.details-close:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.details-body {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.detail-section {
  background: #f8fafc;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #667eea;
}

.detail-section h3 {
  margin: 0 0 15px 0;
  color: #334155;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-url {
  color: #3b82f6;
  text-decoration: none;
  word-break: break-all;
  font-size: 14px;
}

.detail-url:hover {
  text-decoration: underline;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.detail-item {
  background: #f8fafc;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.detail-item strong {
  display: block;
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.hash-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hash-item {
  background: white;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.hash-item strong {
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  margin-right: 10px;
}

.hash-item code {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 11px;
  color: #334155;
  word-break: break-all;
}

.ots-section {
  background: #fef3c7;
  border-left-color: #f59e0b;
}

.verify-ots-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.verify-ots-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.nostr-section {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border-left-color: #0ea5e9;
}

.event-id {
  display: block;
  padding: 10px;
  background: white;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 11px;
  word-break: break-all;
  margin: 10px 0;
}

.nostr-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nostr-links a {
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.nostr-links a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Error states */
.viewer-error {
  text-align: center;
  padding: 40px;
}

.viewer-error h3 {
  color: #dc2626;
  margin-bottom: 10px;
}

.viewer-error p {
  color: #64748b;
  margin-bottom: 20px;
}

.fallback-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.fallback-link:hover {
  text-decoration: underline;
}