:root{
  --gap:14px;
  --card-radius:16px;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color:#2c3e50;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== FLOATING CONTROL PANEL (REPLACES OLD HEADER) ===== */
.floating-controls {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  background: rgba(243, 231, 98, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  min-width: 200px;
  transition: all 0.3s ease;
  animation: slideInLeft 0.6s ease-out;
}

.floating-controls:hover {
  background: rgba(243, 231, 98, 1);
  transform: translateY(-50%) scale(1.02);
}

.control-item {
  margin-bottom: 12px;
}

.control-item:last-child {
  margin-bottom: 0;
}

.panel-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  text-align: center;
}

.back-btn {
  display: inline-block;
  text-decoration: none;
  color: #333;
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
}

.control-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-btn {
  display: inline-block;
  text-decoration: none;
  color: #333;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  text-align: center;
  transition: all 0.2s ease;
}

.panel-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
}

/* ===== MAIN LAYOUT (NO HEADER OFFSET NEEDED) ===== */
.viewer-layout{
  display: grid;
  grid-template-columns: 1fr 360px;    /* viewer | details */
  gap: 0;
  height: 100vh;
  padding: 0;
}

/* Viewer area - full height */
.viewer-wrap {
  position: relative;
}

.viewer-wrap voyager-explorer{
  display: block;
  width: 100%;
  height: 100vh;
  background: #000;
  border: none;
  border-radius: 0;
}

/* Right details panel */
.details-panel{
  background: #fff;
  border-left: 1px solid #eee;
  padding: 20px;
  overflow-y: auto;
  height: 100vh;
}

.details-panel__header{
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 16px;
}

.details-panel h2{
  margin: 0;
  font-size: 20px;
  color: #333;
}

/* Collapsible sections */
.dp-section{
  margin: 16px 0;
  border-radius: 10px;
  overflow: hidden;
}

.dp-section > summary{
  cursor: pointer;
  list-style: none;                 /* hide default marker */
  padding: 12px 16px;
  background: #f8f9fa;
  border: 1px solid #eee;
  border-radius: 10px;
  font-weight: 600;
  font-size: 16px;
}

.dp-section[open] > summary{
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
}

.dp-body{
  border: 1px solid #eee;
  border-top: none;
  padding: 16px;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  background: #fff;
}

/* Key/Value list */
.kv{ margin: 0; }
.kv div{ 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 12px; 
  padding: 8px 0; 
  border-bottom: 1px dashed #eee; 
}
.kv div:last-child{ border-bottom: 0; }
.kv dt{ color: #555; font-weight: 600; }
.kv dd{ margin: 0; word-break: break-word; }

/* ===== HOMEPAGE STYLES (FOR index.html) ===== */

/* Header Styles */
.site-header {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  padding: 2rem 0;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
}

.site-header h1 {
  margin: 0;
  font-size: 3rem;
  font-weight: 700;
  color: #ecf0f1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
}

.site-header .controls {
  margin-top: 1.5rem;
  position: relative;
  z-index: 1;
}

/* Footer Styles */
.site-footer {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  padding: 1.5rem 0;
  margin-top: auto;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.footer-content {
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-content p {
  margin: 0;
  color: #bdc3c7;
  font-size: 1rem;
}

.footer-content a {
  color: #3498db;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-content a:hover {
  color: #5dade2;
  text-decoration: underline;
}

/* Main content wrapper */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Ensure full height layout */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}
.controls{
  margin:0 auto;
  display:flex;
  gap:12px;
  justify-content:center;
  flex-wrap: wrap;
}
.controls input,.controls select{
  padding:12px 16px;
  border:2px solid rgba(255, 255, 255, 0.2);
  border-radius:25px;
  background:rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  min-width:220px;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.controls input:focus,.controls select:focus{
  outline: none;
  border-color: #3498db;
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:var(--gap);
  padding:var(--gap)
}

.card{
  display:block;
  border-radius:var(--card-radius);
  overflow:hidden;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border:2px solid rgba(255, 255, 255, 0.3);
  text-decoration:none;
  color:inherit;
  box-shadow:0 8px 25px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  border-color: rgba(52, 152, 219, 0.5);
}

.card img{
  width:100%;
  height:160px;
  object-fit:cover;
  background:#000
}

.card .meta{padding:10px 12px}
.card .title{margin:.2rem 0 .3rem;font-size:16px;line-height:1.25}
.card .tags{margin:0;color:#666;font-size:12px}
.empty{padding:40px;text-align:center;color:#666}

/* ===== MODAL STYLES ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  text-align: center;
  animation: slideIn 0.3s ease;
}

.modal-content h2 {
  margin: 0 0 20px 0;
  font-size: 24px;
  color: #333;
}

.modal-content p {
  margin: 0 0 25px 0;
  font-size: 16px;
  line-height: 1.5;
  color: #555;
}

.modal-content a {
  color: #007bff;
  text-decoration: none;
}

.modal-content a:hover {
  text-decoration: underline;
}

.close-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.close-btn:hover {
  background: #0056b3;
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== ANIMATIONS ===== */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100px) translateY(-50%);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(-50%);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px){
  .viewer-layout{
    grid-template-columns: 1fr;
  }
  
  .details-panel{
    display: none; /* Hide on mobile, or make it a toggle */
  }
  
  .floating-controls {
    left: 10px;
    min-width: 160px;
    padding: 12px;
  }
  
  .panel-title {
    font-size: 16px;
  }
  
  .panel-btn, .back-btn {
    padding: 8px 10px;
    font-size: 13px;
  }
}

@media (max-width: 640px){
  .floating-controls {
    left: 8px;
    min-width: 140px;
    padding: 10px;
  }
  
  .control-actions {
    gap: 6px;
  }
}