/* ============================
   🌸 체리 애니메이션
============================ */
.cherry-container {
  position: fixed;
  width: 100%;
  height: calc(100vh - 100px);
  margin-bottom: -100px; /* 검색창에 가까이 */
  overflow: hidden;
}

#cherry-canvas {
  position: absolute; /* ✅ fixed → absolute */
  top: 10px;          /* ✅ header 아래부터 시작 */
  left: 0;
  width: 100vw;
  height: 80vh;
  z-index: 1; /* 검색창보다 위, 메뉴보다 아래 */
  pointer-events: none;
}

/* ============================
   🔍 검색창 + 캐릭터 위치
============================ */
.search-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-top: 3rem;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  box-sizing: border-box;
}



.search-wrapper {
  width: 100%;
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-position-anchor {
  position: relative;
  width: 100%;
}

.search-form {
  position: relative;
  width: 100%;
  height: 43px;
  padding: 0 1.5rem;
  border: 1px solid #c28383;
  border-radius: 99px;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.search-form:hover {
  border-color: #9d6bff;
  box-shadow: 0 0 8px rgba(157, 107, 255, 0.6);
}

.character-stand {
  position: absolute;
  bottom: 100%;
  left: 20px;
  transform: translateY(7px);
  pointer-events: none;
  z-index: 1000;
}

#character-svg {
  width: 240px;
  height: auto;
}

@media (max-width: 640px) {
  #character-svg {
    width: 80%;
    min-width: 150px;
    max-width: 240px;
    height: auto;
  }
}

/* ============================
   🌬️ 캐릭터 애니메이션
============================ */
.character-anim {
  opacity: 1;
  transition: opacity 0.4s ease;
}

/* ============================
   🧱 전체 레이아웃
============================ */
.full-layout {
  display: flex;
  justify-content: space-between;
  flex-wrap: nowrap;
  align-items: flex-start;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}

.main-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 0;
  flex-wrap: nowrap;
  min-width: 0;
}

.main-panel {
  background-color: transparent;
  min-height: 100vh;
  flex-direction: column;
  padding: 0 0.5rem;
  display: flex;
  width: 100%;
  align-items: center;
  max-width: calc(100vw - 400px);
}

.side-panel {
  flex: 1;
  max-width: 200px;
  min-width: 200px;
  background-color: transparent;
  border-radius: 0;
  min-height: 100vh;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.03);
  opacity: 0.95;
  overflow: hidden;
  padding: 0 0.5rem;
  z-index: 8000;
}

.side-panel.right-panel-only {
  flex-shrink: 0;
  width: 200px;
}

/* ============================
   🧾 탭 + 게시판 (데스크탑)
============================ */
.tab-board {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1rem;
  font-family: 'Noto Sans KR', sans-serif;
}

.tabs-wrapper {
  display: block;
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  padding: 0 0.2rem;
  margin-bottom: 0.1rem;
  box-sizing: border-box;
}

.tabs-wrapper {
  overflow-x: auto;        /* 가로 스크롤 가능 */
  -ms-overflow-style: none; /* IE/Edge용 */
  scrollbar-width: none;    /* Firefox용 */
}

.tabs-wrapper::-webkit-scrollbar {
  display: none;           /* Chrome/Safari/Edge용 */
}

.tabs-container {
  position: relative;
  width: 100%;
}

/* 왼쪽 블러 */
.tabs-blur-left {
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 248, 250, 0.6) 40%,
    rgba(255, 240, 245, 0.2) 80%,
    rgba(255, 240, 245, 0) 100%
  );
  z-index: 5;
}

/* 오른쪽 블러 */
.tabs-blur-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    to left,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 248, 250, 0.6) 40%,
    rgba(255, 240, 245, 0.2) 80%,
    rgba(255, 240, 245, 0) 100%
  );
  z-index: 5;
}

html.dark .tabs-blur-right {
  background: linear-gradient(to left,
    rgba(11, 11, 26, 1) 0%,
    rgba(11, 11, 26, 0.6) 30%,
    rgba(11, 11, 26, 0.2) 60%,
    rgba(11, 11, 26, 0) 100%);
}

html.dark .tabs-blur-left {
  background: linear-gradient(to right,
    rgba(11, 11, 26, 1) 0%,
    rgba(11, 11, 26, 0.6) 30%,
    rgba(11, 11, 26, 0.2) 60%,
    rgba(11, 11, 26, 0) 100%);
}



.tabs {
  display: inline-flex; /* ✅ 핵심 */
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 0.5rem;
  padding: 1rem 0;
}

.tab {
  margin-top: 2rem;
  padding: 0.3rem 0.9rem;
  border: 1px solid #d0cce6;
  background: #f9eded;
  cursor: pointer;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #2a2a2a;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease-in-out;
  text-decoration: none;
}



.tab:hover {
  color: #d14da8;
  background-color: rgba(247, 243, 255, 0.3);
  border-color: #c4b2ff;
}

.tab.active {
  background: #f6f6f6;
  color: black;
  border-color: #ff9999;
  font-weight: bold;
}


.tabs::-webkit-scrollbar {
  display: none;
}

.tab:hover {
  background-color: #f7f3ff;
  border-color: #c4b2ff;
}

.tab.active {
  background: #ffe4e1;
  border-color: #ff9999;
  font-weight: bold;
}

@media (max-width: 640px) {
  .tabs-wrapper {
    width: 100%;
    max-width: 95vw;

    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  
    /* 스크롤바 감추기 (크롬, 사파리, 엣지) */
    scrollbar-width: none;  
  }

  .tabs-wrapper::-webkit-scrollbar {
    display: none;                 /* Webkit 계열 */
  }

  .tab{
    font-size: 0.7rem;
    padding: 0.25rem 0.7rem;
  }
}

.board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  box-sizing: border-box;
  z-index: 2;
}

.board-table th,
.board-table td {
  padding: 0.65rem;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

.board-table th {
  background-color: #fafafa;
  text-align: center;
  color: #333;
}

.board-table td a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
}

.board-table td a:hover {
  color: #ff6666;
  text-decoration: underline;
}

.board-table td a.post-detail-link {
  display: inline-block;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-table td .action-icons {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 0.3rem;
  gap: 0rem;
}

/* ============================
   ✍️ 수정/삭제 버튼
============================ */
.icon-btn,
.action-icons a,
.action-icons form,
form button {
  margin: 0;
  padding: 0.3rem 0.6rem;
  font-size: 1.1rem;
  color: #666;
  background: none;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover,
form button:hover {
  color: #d9534f;
}

.icon-btn i {
  margin-right: 0.2rem;
}

/* ============================
   📱 모바일 게시판
============================ */
.mobile-board-list {
  display: none;
}

@media (max-width: 640px) {

  .full-layout {
    flex-direction: column;
    align-items: center;
  }

  .side-panel {
    display: none;
  }

  .main-layout,
  .main-panel,
  .search-container,
  .tab-board {
    width: 100%;
    max-width: 100%;
    padding: 0 0.8rem;
    box-sizing: border-box;
  }

  .main-panel {
    min-width: 320px;
    margin-top: 0.5rem;
  }

  .tabs {
    padding: 0 1rem; 
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: max-content;
  }


  .board-table {
    display: none;
  }

  .mobile-board-list {
    display: block;
    padding: 0rem 0.1rem;
    margin-top: 1rem;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
    position: relative;
    z-index: 3;
  }

  .mobile-post-item {
    box-sizing: border-box;
    padding-left: 0rem;
    padding-right: 0rem;
    width: 100%;
    position: relative;
    padding: 0.3rem 0;
  }

  .mobile-post-item::after {
    content: '';
    position: absolute;
    left: 0rem;
    right: 0rem;
    bottom: 0;
    height: 0.5px;
    background-color: #870000;
  }

  html.dark .mobile-post-item::after{
    background-color: #ddd;
  }

  .mobile-post-item .post-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    display: block;
    margin-bottom: 0.1rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-post-item .post-title:hover {
    color: #a26bff;
    text-decoration: underline;
  }

  .mobile-post-item .post-info {
    font-size: 0.7rem;
    color: #777;
  }
}

/* ============================
   🎀 제목과 버튼 정렬
============================ */
.post-title-and-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.post-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  max-width: none;
  font-size: clamp(0.9rem, 4vw, 1.5rem);
}

.action-icons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

@media (max-width: 640px) {
  .action-icons {
    gap: 0.1rem;
  }

  .icon-btn,
  .action-icons a,
  .action-icons form,
  form button {
    padding: 0.2rem 0.2rem;
    font-size: 0.9rem; /* 필요시 더 줄여줘도 돼 */
  }
}

.post-info {
  display: flex;
  margin-top: 0.2rem;
  margin-bottom: 0.2rem;
  font-size: 0.7rem;
  color: #777;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
  width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.post-title-and-actions + .post-info {
  margin-top: 0.1rem;
}

/* ============================
   📌 상단고정 스타일
============================ */
.pinned-title {
  color: #000 !important;
  font-weight: bold !important;
}

html.dark body .pinned-title {
  color: #fefefe !important;
  font-weight: bold !important;
}

/* ============================
   🔖 배지 스타일
============================ */
@keyframes wiggle-float {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-1px) rotate(-2deg); }
  60% { transform: translateY(0) rotate(1deg); }
  80% { transform: translateY(1px) rotate(-1deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.label-icon {
  display: inline-block;
  height: 20px;
  background-repeat: no-repeat;
  background-size: contain;
  vertical-align: middle;
  animation: wiggle-float 0.9s ease-in-out infinite;
}

.new-icon,
.edited-icon {
  height: 20px;
  background-repeat: no-repeat;
  background-size: contain;
  display: inline-block;
}

.new-icon {
  width: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 20'><text x='0' y='15' font-size='16' font-weight='bold' font-family='Arial Black' fill='%23f7971e' stroke='%23bb88aa' stroke-width='0.6'>NEW!</text></svg>");
}

.edited-icon {
  width: 58px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 20'><text x='0' y='15' font-size='15' font-weight='bold' font-family='Arial Black' fill='%233399ff' stroke='%23bb88aa' stroke-width='0.6'>EDITED</text></svg>");
}

html.dark body .new-icon {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 20'><defs><linearGradient id='grad' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' stop-color='%23f7971e'/><stop offset='100%' stop-color='%23ffd200'/></linearGradient></defs><text x='0' y='15' font-size='14' font-weight='bold' font-family='Arial Black' fill='url(%23grad)' stroke='white' stroke-width='0.6'>NEW!</text></svg>");
}

html.dark body .edited-icon {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 20'><defs><linearGradient id='grad-edited' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' stop-color='%2300c6ff'/><stop offset='100%' stop-color='%230072ff'/></linearGradient></defs><text x='0' y='15' font-size='14' font-weight='bold' font-family='Arial Black' fill='url(%23grad-edited)' stroke='white' stroke-width='0.6'>EDITED</text></svg>");
}

/* ============================
   🔍 검색결과 메시지
============================ */
.search-result-msg {
  margin: 2rem auto 1.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  color: #888;
  text-align: center;
  font-weight: 400;
  font-style: italic;
  border-left: 3px solid #fe6ebe;
  background: #fff6fa;
  max-width: 520px;
  border-radius: 0 6px 6px 0;
}

html.dark body .search-result-msg {
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid #faf5b6;
  color: #ccc;
}

/* ============================
   📦 광고 박스 (좌패널)
============================ */
.ad-box {
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

@keyframes slide-expand {
  0% {
    transform: scaleX(0);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: scaleX(1);
    opacity: 1;
  }
}

.fixed-search-wrapper {
  display: none;
  position: static;
  top: 100%; /* 헤더 내부에서 아래로 약간 뜨는 느낌이면 사용 */
  left: 0;

  width: 100%;
  background-color: transparent;
  box-shadow: none;
  margin: 0rem; 

  display: flex;
  align-items: center;

  max-width: 95vw; 
  padding: 0 1vw;        /* ✅ 좌우 패딩 줄이기 */
  z-index: 5000;            /* ✅ 헤더 위에 올려야 하면 */

  animation: slide-expand 0.5s ease forwards;
}


/* 🧼 공통 스타일 */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 1.2rem 0;
  font-size: 0.85rem;
  z-index: 9999;
}

.page-link {
  display: inline-block;
  margin: 0rem 0.1rem; 
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  background-color: #f0f0f0;
  color: #333;
  text-decoration: none;
  border: 1px solid #ddd;
  transition: background 0.2s ease, color 0.2s ease;
}

.page-link:hover {
  background-color: #e2e2e2;
}

/* ✅ 현재 페이지 */
.page-link.active {
  background-color: #ff99cc;
  border-color: #ff66aa;
  color: #fff;
  font-weight: bold;
}

/* 📱 모바일 전용 */
@media (max-width: 768px) {
  .pagination {
    font-size: 0.8rem;
    gap: 0.3rem;
  }

  .page-link {
    padding: 0.35rem 0.6rem;
  }
}

/* 🌙 다크모드 대응 */
html.dark .pagination {
  background: transparent;
}

html.dark .page-link {
  background-color: #444;
  color: #eee;
  border-color: #666;
}

html.dark .page-link:hover {
  background-color: #555;
  color: #fff;
}

html.dark .page-link.active {
  background-color: #ff66aa;
  border-color: #ff3388;
  color: white;
}



/* ✅ PC 전용 */
.desktop-only {
  display: block;
}
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
}

/* ✅ 모바일 전용 */
.mobile-only {
  display: none;
}
@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }
}

.page-link.disabled {
  color: #ccc;
  background-color: #eee;
  pointer-events: none;
  cursor: default;
}
html.dark .page-link.disabled {
  color: #555;
  background-color: #333;
}

.panel-section {
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.panel-section .desktop {
}

.panel-section .mobile {
  padding: 1.3rem 2.1rem;
  margin-left: -2rem;
  margin-bottom: 0rem;
}


.panel-title {
  font-weight: bold;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
  color: #444;
}

.app-button-group {
  display: flex;
  flex-direction: column;
  width: 90%;
  margin-right: 0.2rem;
  gap: 0.4rem;
}

.app-button-group .mobile {
  width: 100%;
}

.app-button {
  width: 100%;
  display: inline-block;
  background: #f0f0f5;
  color: transparent;
  text-decoration: none;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-family: 'Gowun Dodum', sans-serif; 
  font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.7); 
  filter: brightness(1.5) contrast(1.3) saturate(1.2);
}

.app-button:hover {
  background: #e0e0f0;
  box-shadow: 0 3px 8px rgba(197, 175, 12, 0.7);
  transform: scale(1.05);
  filter: brightness(2.0) contrast(1.0) saturate(1.2);
}

/* 🌞 라이트 기본 */
.panel-title {
  color: #444;
}


/* 🌙 다크모드 */
html.dark .panel-title {
  color: #ddd;
}

html.dark .app-button {       /* 어두운 배경 */
  color: transparent;
}

html.dark .app-button:hover {
}


.app-button.tetris {
  background-image: 
  url('/assets/images/apps/tetris.png'); /* 🎮 원래 그림 */
}

.app-button.sudoku {
  background-image:
  linear-gradient(to right, rgba(0, 0, 0, 0.6), rgba(255, 255, 255, 0.05)), /* ✨ 어두→밝은 그라데이션 추가 */
  url('/assets/images/apps/sudoku.png'); /* 🎮 원래 그림 */
}

.app-button.hearing-test {
  background-image:
  linear-gradient(to right, rgba(0, 0, 0, 0.6), rgba(255, 255, 255, 0.05)), /* ✨ 어두→밝은 그라데이션 추가 */
  url('/assets/images/apps/hearing-test.png'); /* 🎮 원래 그림 */
}

.app-button {
  background-size: 100% auto;  /* 가로에 맞추고 세로는 자동 */
  background-repeat: no-repeat;
  background-position: center top; /* 초기 위치 */
  transition: background-position 0.4s ease; /* 부드럽게 이동 */

  font-family: 'Press Start 2P', cursive;
  font-size: 1rem;
  font-weight: bold;
  color: transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
}


.app-button:hover {
  background-position: bottom; /* 아래쪽 영역으로 슬라이드 */
  background-size: 100% auto;
}

.tab-spacer {
  width: 1.5rem; /* 원하는 초기 여백 */
  flex-shrink: 0;
  pointer-events: none;
}
