* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f8f8f8;
  color: #1a1a1a;
}

/* Main Body */
.mainBody {
  flex: 1;
  display: flex;
  margin-top: 10%;
  flex-direction: column;
  align-items: center;
}

.mainBody img {
  object-fit: contain;
  height: 100px;
  margin-bottom: 40px;
}

/* Search Container */
.search {
  width: 90%;
  max-width: 750px;
}

/* ==================== FICHERO CLÁSICO ==================== */

/* Selector de Carpetas */
.file-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.file-card {
  background: #fff;
  border: 1px solid #d0d0d0;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Pestaña superior de la carpeta */
.file-tab {
  height: 12px;
  background: #8b7355;
  border-bottom: 1px solid #7b6345;
  position: relative;
}

/* Marca blanca en la pestaña */
.file-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  width: 60%;
  height: 4px;
  background: #fff;
  border-radius: 2px;
}

/* Contenido de la carpeta */
.file-content {
  padding: 20px 15px 18px;
  text-align: center;
}

.card-emoji {
  font-size: 2rem;
  margin-bottom: 10px;
}

.card-text {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  color: #333;
}

.card-desc {
  font-size: 0.7rem;
  color: #999;
}

/* Hover State */
.file-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.file-card:hover .file-tab {
  background: #9b8365;
}

/* Selected State */
.file-card.selected {
  background: #fffbf0;
  box-shadow: 0 6px 12px rgba(212, 165, 116, 0.3);
}

.file-card.selected .file-tab {
  background: #d4a574;
  border-bottom-color: #c49564;
}

/* ==================== SEARCH INPUT ==================== */

.search__input {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #d0d0d0;
  height: 46px;
  padding: 0 20px;
  border-radius: 8px;
  margin: 0 auto;
  margin-top: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.search__input input {
  flex: 1;
  padding: 10px 15px;
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
  font-size: 0.95rem;
}

.search__input .material-icons {
  color: #999;
  font-size: 20px;
}

.modo-oscuro-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  margin-left: 10px;
  transition: opacity 0.3s ease;
}

.modo-oscuro-btn:hover {
  opacity: 0.7;
}

/* ==================== BOTÓN FICHERO ==================== */

.search__buttons {
  margin-top: 30px;
  display: flex;
  justify-content: center;
}

.btn-file-search {
  padding: 16px 40px;
  background: #8b7355;
  color: #fff;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  letter-spacing: 1.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  position: relative;
  clip-path: polygon(0 0, 90% 0, 100% 10%, 100% 100%, 0 100%);
  transition: all 0.3s;
}

.btn-file-search::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 15px;
  height: 15px;
  background: #6b5335;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.btn-file-search:hover {
  background: #9b8365;
}

.btn-file-search:active {
  transform: translateY(1px);
}

.btn-icon {
  font-size: 1.2rem;
}

/* ==================== EMOJIS ANIMADOS ==================== */

.emoji-random {
  position: fixed;
  opacity: 0.3;
  z-index: 9999;
  animation: desvanecer 6s ease-out forwards;
  pointer-events: none;
}

@keyframes desvanecer {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.5) rotate(180deg);
  }
  100% {
    transform: scale(0) rotate(360deg);
    opacity: 0;
  }
}

/* ==================== FOOTER ==================== */

.footer {
  text-align: center;
  padding: 30px 70px;
  font-size: 0.8rem;
  color: #999;
  margin-top: auto;
  background: #8b7355;
  border: 4px solid #6b5335;
  font-family: 'Courier New', monospace;
  position: relative;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.4);
}

.footer::before,
.footer::after {
  content: '●';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #3a3530;
  font-size: 2rem;
  text-shadow: 2px 2px 4px rgba(255,255,255,0.3);
}

.footer::before {
  left: 25px;
}

.footer::after {
  right: 25px;
}

.footer strong {
  color: #fff;
  font-weight: 900;
  font-size: 1.1em;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.footer-text {
  color: #fff;
  font-weight: 400;
}

/* ==================== MODO OSCURO ==================== */

.dark-mode {
  background-color: #1a1a1a;
  color: #f1f1f1;
}

.dark-mode .file-card {
  background: #2a2520;
  border-color: #3a3530;
  color: #d0d0d0;
}

.dark-mode .file-card.selected {
  background: #3a3020;
  border-color: #4a4030;
}

.dark-mode .card-text {
  color: #d0d0d0;
}

.dark-mode .search__input {
  background-color: #2a2a2a;
  border: 1px solid #3a3a3a;
}

.dark-mode .search__input input {
  color: #f1f1f1;
}

.dark-mode .search__input .material-icons {
  color: #888;
}

.dark-mode .btn-file-search {
  background: #6b5335;
  box-shadow: 0 4px 0 #4b3325;
}

.dark-mode .btn-file-search:hover {
  background: #7b6345;
  box-shadow: 0 6px 0 #4b3325;
}

.dark-mode .btn-file-search:active {
  box-shadow: 0 2px 0 #4b3325;
}

.dark-mode .footer {
  background: #8b7355;
  border: 4px solid #6b5335;
  color: #fff;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  .file-selector {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .mainBody {
    margin-top: 15%;
  }

  .mainBody img {
    height: 80px;
    margin-bottom: 30px;
  }

  .btn-file-search {
    padding: 14px 30px;
    font-size: 0.85rem;
  }

  .search {
    width: 95%;
  }
}

@media (max-width: 480px) {
  .card-emoji {
    font-size: 1.5rem;
  }

  .card-text {
    font-size: 0.75rem;
  }

  .card-desc {
    font-size: 0.65rem;
  }
}