/* ── Folder Component (Vanilla JS) ── */

.folder-wrapper {
  display: inline-block;
  transform-origin: center;
}

.folder {
  transition: all 0.2s ease-in;
  cursor: pointer;
}

.folder:not(.open):hover {
  transform: translateY(-8px);
}

.folder:not(.open):hover .folder-paper {
  transform: translate(-50%, 0%);
}

.folder:not(.open):hover .folder__front {
  transform: skew(15deg) scaleY(0.6);
}

.folder:not(.open):hover .folder__front.right {
  transform: skew(-15deg) scaleY(0.6);
}

.folder.open {
  transform: translateY(-8px);
}

.folder.open .folder-paper:nth-child(1) {
  transform: translate(-120%, -70%) rotateZ(-15deg);
}

.folder.open .folder-paper:nth-child(1):hover {
  transform: translate(-120%, -70%) rotateZ(-15deg) scale(1.1);
}

.folder.open .folder-paper:nth-child(2) {
  transform: translate(10%, -70%) rotateZ(15deg);
  height: 80%;
}

.folder.open .folder-paper:nth-child(2):hover {
  transform: translate(10%, -70%) rotateZ(15deg) scale(1.1);
}

.folder.open .folder-paper:nth-child(3) {
  transform: translate(-50%, -100%) rotateZ(5deg);
  height: 80%;
}

.folder.open .folder-paper:nth-child(3):hover {
  transform: translate(-50%, -100%) rotateZ(5deg) scale(1.1);
}

.folder.open .folder__front {
  transform: skew(15deg) scaleY(0.6);
}

.folder.open .folder__front.right {
  transform: skew(-15deg) scaleY(0.6);
}

.folder__back {
  position: relative;
  width: 100px;
  height: 80px;
  background: var(--folder-back-color, #4785ff);
  border-radius: 0px 10px 10px 10px;
}

.folder__back::after {
  position: absolute;
  z-index: 0;
  bottom: 98%;
  left: 0;
  content: '';
  width: 30px;
  height: 10px;
  background: var(--folder-back-color, #4785ff);
  border-radius: 5px 5px 0 0;
}

.folder-paper {
  position: absolute;
  z-index: 2;
  bottom: 10%;
  left: 50%;
  transform: translate(-50%, 10%);
  width: 70%;
  height: 80%;
  background: var(--paper-1, #e6e6e6);
  border-radius: 10px;
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.folder-paper:nth-child(2) {
  background: var(--paper-2, #f2f2f2);
  width: 80%;
  height: 70%;
}

.folder-paper:nth-child(3) {
  background: var(--paper-3, #ffffff);
  width: 90%;
  height: 60%;
}

.folder__front {
  position: absolute;
  z-index: 3;
  width: 100%;
  height: 100%;
  background: var(--folder-color, #70a1ff);
  border-radius: 5px 10px 10px 10px;
  transform-origin: bottom;
  transition: all 0.3s ease-in-out;
}

/* Paper content styling */
.paper-content {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro", "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  color: #1a1a2e;
  text-align: center;
  line-height: 1.2;
  padding: 4px;
  opacity: 0;
  transition: opacity 0.4s ease 0.2s;
  pointer-events: none;
  user-select: none;
}

.folder.open .paper-content {
  opacity: 1;
}

.paper-emoji {
  font-size: 14px;
  display: block;
  margin-bottom: 2px;
}

/* ── Folder Section Container ── */
.folder-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.folder-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.7;
}

.folder-hint {
  font-size: 11px;
  color: var(--text-soft);
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: hintPulse 2s ease-in-out infinite;
}

.folder-section:hover .folder-hint {
  opacity: 1;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}
