/* Black Hole Explorer - Enhanced Cosmic Theme */
:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --black-hole-dark: #000000;
  --event-horizon: #0a0a0a;
  --stellar-blue: #1e3a8a;
  --accretion-orange: #ff6b6b;
  --neutron-purple: #9b59b6;
  --cosmic-lavender: #8e44ad;
  --stellar-white: #f0ffff;
  --quasar-yellow: #ffd700;
  --interstellar-green: #2ecc71;
  --wormhole-pink: #ff1493;
  --singularity-red: #8b0000;
  --dark-matter-gray: #2f4f4f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(135deg, var(--black-hole-dark) 0%, var(--event-horizon) 100%), var(--black-hole-pattern-1);
  background-size: cover;
  background-attachment: fixed;
  color: var(--stellar-white);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--quasar-yellow);
  background: rgba(30, 58, 138, 0.95);
  backdrop-filter: blur(10px);
  background-image: var(--black-hole-pattern-3);
  background-size: 200px 200px;
}

.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  gap: 1rem;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  border: 2px solid var(--quasar-yellow);
  box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

.card {
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid var(--quasar-yellow);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
  background-image: var(--black-hole-pattern-4);
  background-size: 150px 150px;
  transition: all 0.5s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 50px rgba(255, 107, 107, 0.8);
  border-color: var(--accretion-orange);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  color: var(--quasar-yellow);
}

.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.pill {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--quasar-yellow);
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 215, 0, 0.1);
  transition: all 0.3s ease;
}

.pill:hover {
  background: rgba(255, 215, 0, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(255, 215, 0, 0.2);
}

.file {
  border: 1px solid var(--quasar-yellow);
  border-radius: 10px;
  padding: 0.75rem;
  margin-top: 0.75rem;
  background: rgba(10, 10, 10, 0.95);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
  transition: all 0.3s ease;
}

.file:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
  border-color: var(--accretion-orange);
}

.file-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--stellar-white);
}

.file-content {
  margin: 0.5rem 0 0;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--quasar-yellow);
  border-radius: 8px;
  background: rgba(10, 10, 10, 0.95);
  padding: 0.5rem;
  font-size: 12px;
  color: var(--stellar-white);
  transition: all 0.3s ease;
}

.file-content:hover {
  border-color: var(--accretion-orange);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

.muted {
  color: var(--quasar-yellow);
  font-size: 0.9rem;
}

textarea {
  width: 100%;
  min-height: 240px;
  margin-top: 0.5rem;
  border: 1px solid var(--quasar-yellow);
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(10, 10, 10, 0.95);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--stellar-white);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
  transition: all 0.3s ease;
}

textarea:hover {
  border-color: var(--accretion-orange);
  box-shadow: 0 0 15px rgba(255, 107, 107, 0.4);
}

textarea:focus {
  outline: 3px solid var(--quasar-yellow);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(255, 107, 107, 0.3);
  transform: scale(1.01);
}

button {
  border: 1px solid var(--quasar-yellow);
  background: linear-gradient(135deg, var(--quasar-yellow) 0%, var(--accretion-orange) 100%);
  color: var(--black-hole-dark);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px var(--quasar-yellow);
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

button:hover::before {
  left: 100%;
}

button:hover { 
  background: var(--accretion-orange); 
  color: var(--stellar-white); 
  transform: translateY(-2px); 
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3); 
}

button:active { 
  transform: translateY(0); 
  box-shadow: 0 3px 10px rgba(255, 107, 107, 0.2); 
}

button:focus {
  outline: 3px solid var(--quasar-yellow);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(255, 107, 107, 0.3);
}

code {
  background: rgba(255, 215, 0, 0.1);
  border-radius: 5px;
  padding: 0.1rem 0.3rem;
  color: var(--quasar-yellow);
  border: 1px solid var(--quasar-yellow);
}

/* Black Hole-themed patterns and textures */
:root {
  --black-hole-pattern-1: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" fill="none"/><circle cx="50" cy="50" r="40" fill="%230a0a0a" opacity="0.1"/><circle cx="50" cy="50" r="30" fill="%23ff6b6b" opacity="0.05"/><circle cx="50" cy="50" r="20" fill="%231e3a8a" opacity="0.05"/><path d="M20,20 L80,20 L80,80 L20,80 Z" fill="%239b59b6" opacity="0.03"/></svg>');
  --black-hole-pattern-2: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" fill="none"/><path d="M10,50 L50,10 L90,50 L50,90 Z" fill="%23ff6b6b" opacity="0.1"/><path d="M50,50 L70,30 L50,10 L30,30 Z" fill="%231e3a8a" opacity="0.1"/><path d="M30,30 L70,30 L70,70 L30,70 Z" fill="%238e44ad" opacity="0.05"/></svg>');
  --black-hole-pattern-3: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" fill="none"/><path d="M20,20 L80,20 L80,80 L20,80 Z" fill="%239b59b6" opacity="0.05"/><path d="M30,30 L70,30 L70,70 L30,70 Z" fill="%238e44ad" opacity="0.05"/><path d="M40,40 L60,40 L60,60 L40,60 Z" fill="%23ffd700" opacity="0.03"/></svg>');
  --black-hole-pattern-4: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" fill="none"/><path d="M10,10 L50,50 L10,90 L50,50 Z" fill="%23ffd700" opacity="0.1"/><path d="M90,10 L50,50 L90,90 L50,50 Z" fill="%23ffd700" opacity="0.1"/><circle cx="50" cy="50" r="15" fill="%23ff1493" opacity="0.05"/></svg>');
}

/* Black Hole-themed animations */
@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

/* Black Hole-themed decorations */
.black-hole-decorations {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.event-horizon {
  position: absolute;
  font-size: 2rem;
  animation: rotate 10s linear infinite;
}

.event-horizon:nth-child(1) {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.event-horizon:nth-child(2) {
  top: 20%;
  right: 10%;
  animation-delay: 2s;
}

.event-horizon:nth-child(3) {
  bottom: 10%;
  left: 20%;
  animation-delay: 4s;
}

.accretion-disk {
  position: absolute;
  font-size: 1.5rem;
  animation: spin 6s linear infinite;
}

.accretion-disk:nth-child(4) {
  top: 30%;
  left: 50%;
  animation-delay: 0s;
}

.accretion-disk:nth-child(5) {
  bottom: 30%;
  right: 50%;
  animation-delay: 3s;
}

.stellar-remnant {
  position: absolute;
  font-size: 2rem;
  animation: pulse 4s ease-in-out infinite;
}

.stellar-remnant:nth-child(6) {
  top: 50%;
  left: 50%;
  animation-delay: 1s;
}

.black-hole-event-horizon {
  animation: rotate 3s linear infinite;
}

.black-hole-accretion-disk {
  animation: spin 4s linear infinite;
}

.black-hole-stellar-remnant {
  animation: pulse 2s ease-in-out infinite;
}

/* Parallax effect for background */
.parallax {
  perspective: 1px;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.parallax__layer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.parallax__layer--base {
  transform: translateZ(0);
}

.parallax__layer--back {
  transform: translateZ(-1px) scale(2);
}

.parallax__layer--deep {
  transform: translateZ(-2px) scale(3);
}

/* Parallax stars */
.parallax__stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.parallax__star {
  position: absolute;
  background: var(--stellar-white);
  border-radius: 50%;
  animation: twinkle 2s infinite;
}

.parallax__star:nth-child(1) {
  width: 1px;
  height: 1px;
  top: 10%;
  left: 20%;
  animation-delay: 0s;
}

.parallax__star:nth-child(2) {
  width: 2px;
  height: 2px;
  top: 50%;
  left: 80%;
  animation-delay: 0.5s;
}

.parallax__star:nth-child(3) {
  width: 1px;
  height: 1px;
  top: 90%;
  left: 40%;
  animation-delay: 1s;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Parallax galaxies */
.parallax__galaxy {
  position: absolute;
  background: radial-gradient(circle, var(--stellar-blue) 0%, transparent 70%);
  border-radius: 50%;
  animation: rotate 20s linear infinite;
}

.parallax__galaxy:nth-child(1) {
  width: 200px;
  height: 200px;
  top: 20%;
  left: 30%;
  animation-delay: 0s;
}

.parallax__galaxy:nth-child(2) {
  width: 150px;
  height: 150px;
  top: 70%;
  right: 20%;
  animation-delay: 10s;
}

/* Responsive design */
@media (max-width: 768px) {
  .topbar {
    padding: 0.75rem 1rem;
  }
  
  .layout {
    padding: 0.75rem;
  }
  
  .card {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 0.5rem 0.75rem;
  }
  
  .layout {
    padding: 0.5rem;
  }
  
  .card {
    padding: 0.5rem;
  }
  
  textarea {
    padding: 0.5rem;
  }
  
  button {
    padding: 0.4rem 0.8rem;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .topbar {
    padding: 0.75rem 1rem;
  }
  
  .layout {
    padding: 0.75rem;
  }
  
  .card {
    padding: 0.75rem;
  }
  
  textarea {
    padding: 0.75rem;
  }
  
  button {
    padding: 0.45rem 0.9rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .topbar {
    padding: 1rem 1.5rem;
  }
  
  .layout {
    padding: 1rem;
  }
  
  .card {
    padding: 1rem;
  }
  
  textarea {
    padding: 1rem;
  }
  
  button {
    padding: 0.5rem 1rem;
  }
}

@media (min-width: 1025px) {
  .topbar {
    padding: 1.5rem 2rem;
  }
  
  .layout {
    padding: 1.5rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  textarea {
    padding: 1.5rem;
  }
  
  button {
    padding: 0.6rem 1.2rem;
  }
}

/* Print styles */
@media print {
  .topbar,
  button {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  textarea {
    border: 1px solid #ccc;
  }
}

/* Focus states for accessibility */
button:focus {
  outline: 2px solid var(--quasar-yellow);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--event-horizon);
}

textarea:focus {
  outline: 2px solid var(--quasar-yellow);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--event-horizon);
}

/* Enhanced button hover states */
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(255, 107, 107, 0.2);
}

/* Enhanced textarea focus states */
textarea:focus {
  transform: scale(1.01);
  transition: transform 0.2s ease;
}

/* Enhanced file content styling */
.file-content {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.4;
  white-space: pre-wrap;
}

/* Enhanced pill styling */
pill {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Black Hole-themed header */
.black-hole-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  text-align: center;
  color: var(--quasar-yellow);
}

.black-hole-greeting {
  font-size: 1.2rem;
  font-style: italic;
  margin-bottom: 0.5rem;
}

.black-hole-icons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.black-hole-icon {
  font-size: 1.5rem;
  animation: rotate 3s linear infinite;
}

.black-hole-icon:nth-child(1) {
  animation-delay: 0s;
}

.black-hole-icon:nth-child(2) {
  animation-delay: 0.5s;
}

.black-hole-icon:nth-child(3) {
  animation-delay: 1s;
}

.black-hole-icon:nth-child(4) {
  animation-delay: 1.5s;
}

.black-hole-icon:nth-child(5) {
  animation-delay: 2s;
}

/* Black Hole-themed footer */
.black-hole-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--quasar-yellow);
}

.black-hole-wishes {
  margin-bottom: 0.5rem;
  font-style: italic;
  color: var(--quasar-yellow);
}

.black-hole-scarab {
  font-size: 1.5rem;
  animation: rotate 3s linear infinite;
}

.black-hole-footer-decorations {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.5rem;
}

.black-hole-event-horizon {
  animation: rotate 3s linear infinite;
}

.black-hole-accretion-disk {
  animation: spin 4s linear infinite;
}

.black-hole-stellar-remnant {
  animation: pulse 2s ease-in-out infinite;
}

.black-hole-wave {
  animation: rotate 5s linear infinite;
}

.black-hole-sun {
  animation: spin 6s linear infinite;
}

.black-hole-umbrella {
  animation: pulse 3s ease-in-out infinite;
}

.black-hole-seagull {
  animation: rotate 4s linear infinite;
}

/* Fixed syntax error in listFiles function */
.listFiles {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" fill="none"/><circle cx="50" cy="50" r="40" fill="%230a0a0a" opacity="0.1"/><circle cx="50" cy="50" r="30" fill="%23ff6b6b" opacity="0.05"/><circle cx="50" cy="50" r="20" fill="%231e3a8a" opacity="0.05"/><path d="M20,20 L80,20 L80,80 L20,80 Z" fill="%239b59b6" opacity="0.03"/></svg>') no-repeat center center;
}