/* ============================================
   🌸 싸이월드 감성 미니홈피 스타일시트 🌸
   ============================================ */

/* Google Fonts - 도트 감성 폰트 */
@import url('https://fonts.googleapis.com/css2?family=DotGothic16&family=Galmuri11&display=swap');

/* CSS 변수 정의 */
:root {
  --primary-sky: #87CEEB;
  --primary-sky-light: #B0E0E6;
  --primary-sky-dark: #5DADE2;
  --accent-pink: #FFB6C1;
  --accent-yellow: #FFFACD;
  --accent-mint: #98FF98;
  --bg-cream: #FFF8DC;
  --text-dark: #2C3E50;
  --text-gray: #7F8C8D;
  --border-pixel: #4A90A4;
  --white: #FFFFFF;
  --shadow-soft: rgba(0, 0, 0, 0.1);
}

/* 기본 리셋 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DotGothic16', 'Galmuri11', '돋움', Dotum, sans-serif;
  background: linear-gradient(135deg, var(--primary-sky-light) 0%, var(--primary-sky) 50%, var(--accent-pink) 100%);
  min-height: 100vh;
  padding: 20px;
  color: var(--text-dark);
  font-size: 14px;
  line-height: 1.6;
}

/* ============================================
   픽셀 아트 테두리 스타일
   ============================================ */
.pixel-border {
  border: 3px solid var(--border-pixel);
  box-shadow: 
    4px 4px 0 var(--border-pixel),
    inset 2px 2px 0 var(--white),
    inset -2px -2px 0 #ccc;
  background: var(--white);
}

.pixel-border-pink {
  border: 3px solid #E91E63;
  box-shadow: 
    4px 4px 0 #C2185B,
    inset 2px 2px 0 var(--white),
    inset -2px -2px 0 #F8BBD9;
}

/* ============================================
   메인 컨테이너 레이아웃
   ============================================ */
.minihompy-container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 
    0 0 0 4px var(--border-pixel),
    0 0 0 8px var(--primary-sky-dark),
    8px 8px 20px var(--shadow-soft);
}

/* ============================================
   헤더 영역
   ============================================ */
.header {
  background: linear-gradient(90deg, var(--primary-sky) 0%, var(--primary-sky-light) 100%);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px dashed var(--border-pixel);
}

.site-title {
  font-size: 20px;
  color: var(--white);
  text-shadow: 2px 2px 0 var(--border-pixel);
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-title::before {
  content: '🏠';
  font-size: 24px;
}

.today-counter {
  background: var(--white);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 12px;
  border: 2px solid var(--border-pixel);
}

.today-counter span {
  color: #E74C3C;
  font-weight: bold;
}

/* ============================================
   탭 네비게이션
   ============================================ */
.tab-navigation {
  background: var(--bg-cream);
  padding: 10px 20px;
  display: flex;
  gap: 5px;
  border-bottom: 2px solid var(--border-pixel);
}

.tab-btn {
  padding: 10px 25px;
  background: var(--white);
  border: 2px solid var(--border-pixel);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-dark);
  transition: all 0.2s ease;
  position: relative;
  top: 2px;
}

.tab-btn:hover {
  background: var(--primary-sky-light);
}

.tab-btn.active {
  background: var(--primary-sky);
  color: var(--white);
  font-weight: bold;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.tab-btn::before {
  margin-right: 5px;
}

.tab-btn[data-page="index"]::before { content: '🏠'; }
.tab-btn[data-page="diary"]::before { content: '📖'; }
.tab-btn[data-page="guestbook"]::before { content: '📝'; }

/* ============================================
   메인 레이아웃 (사이드바 + 콘텐츠)
   ============================================ */
.main-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 500px;
}

/* ============================================
   왼쪽 사이드바
   ============================================ */
.left-sidebar {
  background: linear-gradient(180deg, var(--accent-yellow) 0%, var(--bg-cream) 100%);
  padding: 20px;
  border-right: 3px dashed var(--border-pixel);
}

/* 프로필 카드 */
.profile-card {
  background: var(--white);
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  margin-bottom: 15px;
  border: 2px solid var(--border-pixel);
  box-shadow: 3px 3px 0 var(--border-pixel);
}

.profile-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-sky-light), var(--accent-pink));
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  border: 3px solid var(--border-pixel);
  box-shadow: inset 0 0 20px rgba(255,255,255,0.5);
}

.profile-name {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.profile-mood {
  font-size: 12px;
  color: var(--text-gray);
  padding: 5px 10px;
  background: var(--accent-yellow);
  border-radius: 10px;
  display: inline-block;
}

/* 미니룸 */
.miniroom {
  background: var(--white);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  border: 2px solid var(--border-pixel);
  box-shadow: 3px 3px 0 var(--border-pixel);
}

.miniroom-title {
  font-size: 12px;
  color: var(--text-gray);
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px dashed var(--border-pixel);
}

.miniroom-space {
  height: 100px;
  background: linear-gradient(to bottom, #E3F2FD 0%, #BBDEFB 100%);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  border: 2px solid #90CAF9;
}

/* 미니룸 아이템들 */
.miniroom-floor {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 30px;
  background: linear-gradient(to bottom, #8D6E63 0%, #6D4C41 100%);
}

.miniroom-character {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 35px;
  animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}

.miniroom-item {
  position: absolute;
  font-size: 20px;
}

.miniroom-item.lamp { top: 10px; right: 15px; }
.miniroom-item.plant { bottom: 30px; left: 10px; }
.miniroom-item.window { top: 5px; left: 10px; font-size: 25px; }

/* 일촌 목록 */
.ilchon-list {
  background: var(--white);
  border-radius: 12px;
  padding: 15px;
  border: 2px solid var(--border-pixel);
  box-shadow: 3px 3px 0 var(--border-pixel);
}

.ilchon-title {
  font-size: 12px;
  color: var(--text-gray);
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px dashed var(--border-pixel);
  display: flex;
  align-items: center;
  gap: 5px;
}

.ilchon-title::before {
  content: '👥';
}

.ilchon-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dotted #eee;
  font-size: 12px;
}

.ilchon-item:last-child {
  border-bottom: none;
}

.ilchon-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-mint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid var(--border-pixel);
}

.ilchon-name {
  flex: 1;
}

.ilchon-relation {
  color: var(--accent-pink);
  font-size: 10px;
}

/* ============================================
   오른쪽 콘텐츠 영역
   ============================================ */
.content-area {
  padding: 20px;
  background: var(--white);
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px dashed var(--border-pixel);
}

.content-title {
  font-size: 18px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   BGM 플레이어
   ============================================ */
.bgm-player {
  background: linear-gradient(135deg, var(--primary-sky-light), var(--accent-pink));
  border-radius: 25px;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--border-pixel);
  box-shadow: 3px 3px 0 var(--border-pixel);
}

.bgm-icon {
  font-size: 18px;
}

.bgm-info {
  flex: 1;
}

.bgm-title {
  font-size: 11px;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.bgm-artist {
  font-size: 10px;
  color: var(--text-gray);
}

.bgm-controls {
  display: flex;
  gap: 5px;
}

.bgm-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border-pixel);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s ease;
}

.bgm-btn:hover {
  background: var(--primary-sky);
  transform: scale(1.1);
}

.bgm-btn.playing {
  background: var(--accent-pink);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 182, 193, 0.7); }
  50% { box-shadow: 0 0 0 8px rgba(255, 182, 193, 0); }
}

/* ============================================
   메인 홈 콘텐츠
   ============================================ */
.home-content {
  display: grid;
  gap: 20px;
}

/* 일촌평 섹션 */
.ilchon-comments {
  background: var(--bg-cream);
  border-radius: 12px;
  padding: 20px;
  border: 2px solid var(--border-pixel);
}

.section-title {
  font-size: 14px;
  color: var(--text-dark);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px dashed var(--border-pixel);
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: var(--white);
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid #eee;
  transition: transform 0.2s ease;
}

.comment-item:hover {
  transform: translateX(5px);
  border-color: var(--primary-sky);
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-mint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 2px solid var(--border-pixel);
  flex-shrink: 0;
}

.comment-content {
  flex: 1;
}

.comment-author {
  font-size: 12px;
  font-weight: bold;
  color: var(--primary-sky-dark);
  margin-bottom: 3px;
}

.comment-text {
  font-size: 13px;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.comment-date {
  font-size: 10px;
  color: var(--text-gray);
}

/* 최근 게시물 */
.recent-posts {
  background: var(--accent-yellow);
  border-radius: 12px;
  padding: 20px;
  border: 2px solid var(--border-pixel);
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: var(--white);
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #eee;
  cursor: pointer;
  transition: all 0.2s ease;
}

.post-item:hover {
  background: var(--primary-sky-light);
  border-color: var(--primary-sky);
}

.post-title {
  font-size: 13px;
  color: var(--text-dark);
}

.post-date {
  font-size: 11px;
  color: var(--text-gray);
}

/* ============================================
   다이어리 페이지
   ============================================ */
.diary-container {
  display: grid;
  gap: 20px;
}

.diary-write-box {
  background: linear-gradient(135deg, var(--accent-yellow) 0%, var(--bg-cream) 100%);
  border-radius: 12px;
  padding: 20px;
  border: 2px solid var(--border-pixel);
}

.diary-input-group {
  margin-bottom: 15px;
}

.diary-input-group label {
  display: block;
  font-size: 12px;
  color: var(--text-gray);
  margin-bottom: 5px;
}

.diary-input {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid var(--border-pixel);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  background: var(--white);
  transition: border-color 0.2s ease;
}

.diary-input:focus {
  outline: none;
  border-color: var(--primary-sky);
  box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.3);
}

.diary-textarea {
  min-height: 120px;
  resize: vertical;
}

.diary-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn {
  padding: 10px 25px;
  border: 2px solid var(--border-pixel);
  border-radius: 20px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 3px 3px 0 var(--border-pixel);
}

.btn:active {
  box-shadow: 1px 1px 0 var(--border-pixel);
  transform: translate(2px, 2px);
}

.btn-primary {
  background: var(--primary-sky);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-sky-dark);
}

.btn-secondary {
  background: var(--white);
  color: var(--text-dark);
}

.btn-secondary:hover {
  background: var(--bg-cream);
}

/* 다이어리 목록 */
.diary-list {
  display: grid;
  gap: 15px;
}

.diary-entry {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  border: 2px solid var(--border-pixel);
  box-shadow: 3px 3px 0 var(--border-pixel);
  transition: transform 0.2s ease;
}

.diary-entry:hover {
  transform: translateY(-3px);
}

.diary-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-pixel);
}

.diary-entry-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--primary-sky-dark);
}

.diary-entry-date::before {
  content: '📅';
}

.diary-entry-mood {
  padding: 5px 12px;
  background: var(--accent-pink);
  border-radius: 15px;
  font-size: 11px;
  color: var(--white);
}

.diary-entry-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.diary-entry-content {
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.8;
}

/* ============================================
   방명록 페이지
   ============================================ */
.guestbook-container {
  display: grid;
  gap: 20px;
}

.guestbook-write-box {
  background: linear-gradient(135deg, var(--accent-mint) 0%, var(--bg-cream) 100%);
  border-radius: 12px;
  padding: 20px;
  border: 2px solid var(--border-pixel);
}

.guestbook-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.guestbook-list {
  display: grid;
  gap: 15px;
}

.guestbook-entry {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  border: 2px solid var(--border-pixel);
  box-shadow: 3px 3px 0 var(--border-pixel);
  display: flex;
  gap: 15px;
}

.guestbook-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-sky-light), var(--accent-pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 3px solid var(--border-pixel);
  flex-shrink: 0;
}

.guestbook-content {
  flex: 1;
}

.guestbook-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.guestbook-author {
  font-size: 14px;
  font-weight: bold;
  color: var(--primary-sky-dark);
}

.guestbook-date {
  font-size: 11px;
  color: var(--text-gray);
}

.guestbook-text {
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.7;
  padding: 15px;
  background: var(--bg-cream);
  border-radius: 8px;
  border-left: 4px solid var(--primary-sky);
}

.guestbook-secret {
  background: #F3E5F5;
  border-left-color: #9C27B0;
}

.guestbook-secret::before {
  content: '🔒 비밀글입니다';
  display: block;
  font-size: 12px;
  color: #9C27B0;
  margin-bottom: 5px;
}

/* ============================================
   푸터
   ============================================ */
.footer {
  background: var(--bg-cream);
  padding: 15px 20px;
  text-align: center;
  border-top: 3px dashed var(--border-pixel);
}

.footer-text {
  font-size: 11px;
  color: var(--text-gray);
}

.footer-text a {
  color: var(--primary-sky-dark);
  text-decoration: none;
}

.footer-hearts {
  margin-top: 5px;
  font-size: 12px;
  color: var(--accent-pink);
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ============================================
   반응형 디자인
   ============================================ */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .main-layout {
    grid-template-columns: 1fr;
  }

  .left-sidebar {
    border-right: none;
    border-bottom: 3px dashed var(--border-pixel);
  }

  .profile-image {
    width: 80px;
    height: 80px;
    font-size: 35px;
  }

  .tab-navigation {
    flex-wrap: wrap;
  }

  .tab-btn {
    flex: 1;
    text-align: center;
    padding: 8px 15px;
  }

  .content-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .bgm-player {
    width: 100%;
    justify-content: center;
  }

  .guestbook-input-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   스크롤바 스타일
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-cream);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-sky);
  border-radius: 5px;
  border: 2px solid var(--bg-cream);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-sky-dark);
}

/* ============================================
   유틸리티 클래스
   ============================================ */
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.hidden { display: none; }

