@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&display=swap');

@keyframes gridScroll {
  from { transform: translate(0, 0); }
  to { transform: translate(40px, 40px); }
}

body {
  background-color: #001a12;
}

body::before {
  content: '';
  position: fixed;
  inset: -40px;
  background-image:
    linear-gradient(rgba(0, 255, 157, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 157, 0.15) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridScroll 8s linear infinite;
  z-index: -1;
  pointer-events: none;
}

#sky {
  display: none;
}

#filecabinet {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  width: min(92vw, 1100px);
  max-height: calc(85vh - 70px);
  font-family: 'VT323', 'Courier New', monospace;
  image-rendering: pixelated;
}

#fc-body {
  background: #0d2f5e;
  border: 3px solid #001a3f;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,0,0,0.3);
  overflow: hidden;
}

#fc-topbar {
  background: #003380;
  border-bottom: 2px solid #001a3f;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#fc-title {
  font-size: 28px;
  color: #b3d4ff;
  letter-spacing: 3px;
  text-transform: uppercase;
}

#fc-path {
  font-size: 14px;
  color: #4d94ff;
  letter-spacing: 1px;
}

#fc-content {
  display: flex;
  min-height: 450px;
  max-height: calc(65vh - 50px);
}

#fc-sidebar {
  width: 260px;
  min-width: 260px;
  background: #0a2240;
  border-right: 2px solid #001a3f;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: #003380 #001a3f;
  will-change: scroll-position;
}

#fc-sidebar::-webkit-scrollbar {
  width: 8px;
}
#fc-sidebar::-webkit-scrollbar-track {
  background: #001a3f;
}
#fc-sidebar::-webkit-scrollbar-thumb {
  background: #003380;
  border-radius: 0;
}

.fc-cat {
  display: flex;
  flex-direction: column;
}

.fc-cat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 18px;
  color: #b3d4ff;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
  user-select: none;
}

.fc-cat-header:hover {
  background: rgba(0, 104, 254, 0.1);
  color: #e0eeff;
}

.fc-cat-header.active {
  background: rgba(0, 80, 204, 0.25);
  color: #fff;
  border-left-color: #0068fe;
}

.fc-cat-icon {
  font-size: 16px;
  width: 18px;
  text-align: center;
  transition: transform 0.2s ease;
}

.fc-cat-header.expanded .fc-cat-icon {
  transform: rotate(90deg);
}

.fc-sub-list {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.fc-sub-list.open {
  grid-template-rows: 1fr;
}

.fc-sub-list > div {
  overflow: hidden;
}

.fc-sub {
  padding: 6px 12px 6px 42px;
  font-size: 16px;
  color: #4d94ff;
  cursor: pointer;
  transition: background 0.1s, color 0.15s;
  border-left: 3px solid transparent;
  user-select: none;
  letter-spacing: 1.5px;
}

.fc-sub:hover {
  background: rgba(0, 104, 254, 0.08);
  color: #b3d4ff;
}

.fc-sub.active {
  background: rgba(0, 80, 204, 0.2);
  color: #e0eeff;
  border-left-color: #0068fe;
}

#fc-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#fc-grid-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: #003380 #0d2f5e;
  will-change: scroll-position;
}

#fc-grid-wrap::-webkit-scrollbar {
  width: 8px;
}
#fc-grid-wrap::-webkit-scrollbar-track {
  background: #0d2f5e;
}
#fc-grid-wrap::-webkit-scrollbar-thumb {
  background: #003380;
}

#fc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.fc-card {
  background: #b3d4ff;
  border: 2px solid #4d94ff;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
  user-select: none;
}

.fc-card:hover {
  transform: translateY(-3px);
  border-color: #0068fe;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.fc-card.selected {
  border-color: #0050cc;
  box-shadow: 0 0 0 2px #0068fe, 0 4px 12px rgba(0,0,0,0.3);
}

.fc-card-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: #1a3a66;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #4d94ff;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-bottom: 2px solid #4d94ff;
}

.fc-card-img-square {
  height: auto;
  aspect-ratio: 1 / 1;
}

.fc-card-body {
  padding: 8px;
}

.fc-card-name {
  font-size: 18px;
  color: #001a3f;
  font-weight: normal;
  line-height: 17px;
  text-shadow: 0 1px 1px rgba(0,104,254,0.15);
  letter-spacing: 2px;
  transform: scaleX(1.1);
  transform-origin: left center;
}

.fc-card-sub {
  font-size: 13px;
  color: #4d94ff;
  margin-top: 2px;
}

#fc-statusbar {
  background: #0a2240;
  border-top: 2px solid #001a3f;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#fc-status-text {
  font-size: 17px;
  color: #b3d4ff;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#fc-count {
  font-size: 15px;
  color: #4d94ff;
  white-space: nowrap;
}

/* MODAL */
#fc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

#fc-modal-overlay.open {
  display: flex;
}

#fc-modal {
  background: #0a2240;
  border: 3px solid #0068fe;
  border-radius: 6px;
  width: min(90vw, 650px);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,104,254,0.3);
  animation: fcModalIn 0.2s ease;
}

@keyframes fcModalIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

#fc-modal-titlebar {
  background: #0050cc;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
  user-select: none;
  font-family: 'Share Tech Mono', monospace;
}

#fc-modal-title {
  font-size: 22px;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
}

#fc-modal-close {
  background: #a0402a;
  color: #fff;
  border: 1px solid rgba(0,0,0,0.3);
  border-radius: 3px;
  width: 28px;
  aspect-ratio: 1;
  font-family: 'Share Tech Mono', monospace;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

#fc-modal-close:hover {
  background: #c5543a;
}

#fc-modal-body {
  padding: 24px;
  font-family: 'Share Tech Mono', monospace;
}

#fc-modal-sub {
  font-size: 13px;
  color: #b3d4ff;
  letter-spacing: 1px;
  margin: 0;
}

#fc-modal-desc {
  font-size: 18px;
  color: #b3d4ff;
  line-height: 1.5;
  margin-bottom: 20px;
}

#fc-modal-img {
  width: 100%;
  height: auto;
  min-height: 150px;
  background: #1a3a66;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #4d94ff;
  letter-spacing: 3px;
  text-transform: uppercase;
  border: 2px solid #4d94ff;
  border-radius: 4px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.fc-carousel-track {
  display: flex;
  transition: transform 0.4s ease;
  width: 100%;
  height: auto;
}

.fc-carousel-track img {
  min-width: 100%;
  height: auto;
  object-fit: contain;
}

.fc-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 20px;
  padding: 8px 12px;
  cursor: pointer;
  z-index: 5;
  border-radius: 3px;
  transition: background 0.15s;
  line-height: 1;
}

.fc-carousel-arrow:hover {
  background: rgba(0,104,254,0.8);
}

.fc-carousel-prev {
  left: 8px;
}

.fc-carousel-next {
  right: 8px;
}

.fc-carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}

.fc-carousel-dot {
  width: 10px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  padding: 0;
}

.fc-carousel-dot.active {
  background: #fff;
}

.fc-carousel-dot:hover {
  background: rgba(255,255,255,0.7);
}

.fc-modal-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: rgba(0,0,0,0.6);
  border: 3px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  z-index: 2;
}

.fc-modal-play-btn:hover {
  background: rgba(0,104,254,0.8);
  transform: translate(-50%, -50%) scale(1.1);
}

.fc-modal-play-btn::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-left: 14px solid #fff;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  margin-left: 4px;
}

.fc-modal-youtube {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  display: none;
}

.fc-modal-youtube iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.fc-video-carousel {
  border-top: 2px solid #4d94ff;
  position: relative;
  overflow: hidden;
}

.fc-video-carousel img {
  width: 100%;
  height: auto;
  display: block;
}

.fc-video-carousel .fc-carousel-track {
  display: flex;
  transition: transform 0.4s ease;
  width: 100%;
}

.fc-video-carousel .fc-carousel-track img {
  min-width: 100%;
  height: auto;
  object-fit: contain;
}

.fc-video-carousel .fc-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 20px;
  padding: 8px 12px;
  cursor: pointer;
  z-index: 5;
  border-radius: 3px;
  transition: background 0.15s;
  line-height: 1;
}

.fc-video-carousel .fc-carousel-arrow:hover {
  background: rgba(0,104,254,0.8);
}

.fc-video-carousel .fc-carousel-prev {
  left: 8px;
}

.fc-video-carousel .fc-carousel-next {
  right: 8px;
}

.fc-video-carousel .fc-carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}

.fc-video-carousel .fc-carousel-dot {
  width: 10px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  padding: 0;
}

.fc-video-carousel .fc-carousel-dot.active {
  background: #fff;
}

.fc-video-carousel .fc-carousel-dot:hover {
  background: rgba(255,255,255,0.7);
}

#fc-modal-link {
  display: inline-block;
  background: #0050cc;
  color: #fff;
  text-decoration: none;
  padding: 10px 24px;
  border: 2px solid #001a3f;
  border-radius: 4px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: background 0.15s;
}

#fc-modal-link:hover {
  background: #0068fe;
}

/* RESPONSIVE */
@media (max-width: 700px) {
  #filecabinet {
    width: 95vw;
    top: 52%;
  }

  #fc-content {
    min-height: 350px;
  }

  #fc-sidebar {
    width: 140px;
    min-width: 140px;
    padding: 4px 0;
  }

  #fc-sidebar .fc-cat-header {
    padding: 8px 10px;
    font-size: 12px;
  }

  #fc-sidebar .fc-sub {
    padding: 5px 10px 5px 32px;
    font-size: 11px;
  }

  #fc-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  #fc-title {
    font-size: 18px;
    letter-spacing: 2px;
  }

  #fc-path {
    font-size: 12px;
  }

  #fc-modal {
    width: 95vw;
  }

  #fc-modal-img {
    height: 150px;
  }

  .fc-card-img {
    height: 90px;
  }

  #fc-modal-body {
    padding: 16px;
  }

  #fc-modal-desc {
    font-size: 15px;
  }

  #fc-modal-titlebar {
    padding: 10px 14px;
  }

  #fc-modal-title {
    font-size: 18px;
  }

  #fc-statusbar {
    padding: 8px 14px;
  }

   #fc-topbar {
     padding: 10px 14px;
   }
}

/* LAPTOP 701px - 1024px: Ajustes para pantallas con escala 125% */
@media (min-width: 701px) and (max-width: 1024px) {
  #filecabinet {
    width: 94vw;
    max-height: calc(80vh - 70px);
    top: 50%;
  }

  #fc-sidebar {
    width: 200px;
    min-width: 200px;
  }

  #fc-sidebar .fc-cat-header {
    padding: 8px 12px;
    font-size: 14px;
  }

  #fc-sidebar .fc-sub {
    padding: 5px 10px 5px 32px;
    font-size: 13px;
  }

  #fc-title {
    font-size: 22px;
  }

  #fc-path {
    font-size: 11px;
  }

  #fc-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 12px;
  }

  #fc-content {
    min-height: 380px;
    max-height: calc(60vh - 50px);
  }

  #fc-modal {
    width: 85vw;
  }
}

/* ====== RESPONSIVE BREAKPOINTS ====== */

/* MOBILE: 320px - 480px */
@media (max-width: 480px) {
  #filecabinet {
    width: 95vw;
    max-height: 90vh;
    top: 52%;
    max-width: none;
  }

  #fc-body {
    border: 2px solid #001a3f;
  }

  #fc-topbar {
    padding: 10px 12px;
  }

  #fc-title {
    font-size: 18px;
    letter-spacing: 2px;
  }

  #fc-path {
    font-size: 10px;
    letter-spacing: 0.5px;
  }

  #fc-content {
    min-height: auto;
    max-height: 75vh;
  }

  #fc-sidebar {
    width: 110px;
    min-width: 110px;
    padding: 4px 0;
  }

  #fc-sidebar .fc-cat-header {
    padding: 6px 8px;
    font-size: 11px;
  }

  #fc-sidebar .fc-sub {
    padding: 4px 8px 4px 28px;
    font-size: 10px;
  }

  #fc-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    padding: 8px;
  }

  #fc-statusbar {
    flex-wrap: wrap;
    padding: 6px 10px;
    font-size: 10px;
    gap: 8px;
  }

  #fc-status-text {
    font-size: 9px;
  }

  #fc-count {
    font-size: 9px;
  }

  /* Modal adjustments */
  #fc-modal {
    width: 90vw;
    max-width: none;
  }

  #fc-modal-titlebar {
    padding: 10px 12px;
  }

  #fc-modal-title {
    font-size: 14px;
  }

  #fc-modal-sub {
    font-size: 10px;
  }

  #fc-modal-body {
    padding: 10px;
  }

  #fc-modal-img {
    height: 150px;
  }

  #fc-modal-desc {
    font-size: 11px;
    padding: 8px;
  }

  .fc-carousel-arrow {
    padding: 4px 6px;
    font-size: 16px;
  }
}

/* TABLET: 481px - 768px */
@media (min-width: 481px) and (max-width: 768px) {
  #filecabinet {
    width: 90vw;
    max-height: 80vh;
    max-width: none;
  }

  #fc-title {
    font-size: 22px;
  }

  #fc-path {
    font-size: 12px;
  }

  #fc-sidebar {
    width: 45%;
  }

  #fc-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    padding: 12px;
  }

  .fc-item-icon {
    width: 50px;
    height: 50px;
  }

  #fc-modal {
    width: 80vw;
  }
}

/* DESKTOP: 769px+ */
@media (min-width: 769px) {
  #filecabinet {
    width: min(92vw, 1100px);
    max-height: 85vh;
  }

  #fc-sidebar {
    width: 260px;
  }

  #fc-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
  }
}
