/* ===========================
   리셋 & 기본 스타일
   =========================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');
@import url('/component/toast.css');
@import url('/component/modal.css');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input, textarea {
  font-family: inherit;
}

/* ===========================
   헤더 스타일
   =========================== */
header, .header, .app-header {
  background-color: #fff;
  padding: 16px 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
}

header h1, .header h1, .app-header h1 {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  flex: 1;
  color: #333;
}

.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.header .left {
  justify-self: start;
}

.header .right {
  justify-self: end;
  position: relative;
}

.back-btn, .icon-btn {
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  color: #333;
  transition: opacity 0.2s;
}

.back-btn:hover, .icon-btn:hover {
  opacity: 0.7;
}

.profile-icon {
  font-size: 28px;
  cursor: pointer;
  transition: transform 0.2s;
}

.profile-icon:hover {
  transform: scale(1.1);
}

/* 드롭다운 메뉴 */
.dropdown {
  position: relative;
  cursor: pointer;
}

.dropdown .menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  overflow: hidden;
  z-index: 1000;
}

.dropdown:hover .menu,
.dropdown.active .menu {
  display: block;
}

.dropdown .menu a {
  display: block;
  padding: 12px 16px;
  color: #333;
  transition: background-color 0.2s;
  cursor: pointer;
}

.dropdown .menu a:hover {
  background-color: #f5f5f5;
}

.dropdown .menu a#logout-btn:hover {
  background-color: #fee;
  color: #dc3545;
}

/* ===========================
   컨테이너 & 레이아웃
   =========================== */
.container, main.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px;
}

.center {
  text-align: center;
}

.mt-16 {
  margin-top: 16px;
}

/* ===========================
   카드 스타일
   =========================== */
.card {
  background-color: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

/* ===========================
   폼 스타일
   =========================== */
.form-box, .form {
  max-width: 480px;
  margin: 24px auto;
}

.form-group, .field {
  margin-bottom: 20px;
}

.form-group label, .label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.form-group input, .input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus, .input:focus {
  outline: none;
  border-color: #FEE500;
  box-shadow: 0 0 0 3px rgba(254, 229, 0, 0.1);
}

.textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  min-height: 120px;
  resize: vertical;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.textarea:focus {
  outline: none;
  border-color: #FEE500;
  box-shadow: 0 0 0 3px rgba(254, 229, 0, 0.1);
}

.helper-text, .helper {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #999;
}

.file {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

/* ===========================
   버튼 스타일
   =========================== */
.btn {
  width: 100%;
  padding: 14px 24px;
  background-color: #FEE500;
  color: #333;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.1s;
  margin-top: 8px;
}

.btn:hover {
  background-color: #fdd800;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.outline {
  background-color: transparent;
  border: 1px solid #ddd;
  color: #333;
}

.btn.outline:hover {
  background-color: #f5f5f5;
  border-color: #999;
}

.btn.outline.danger {
  color: #dc3545;
  border-color: #dc3545;
}

.btn.outline.danger:hover {
  background-color: #dc3545;
  color: white;
}

.write-btn {
  max-width: 200px;
  margin: 20px auto;
  display: block;
}

/* ===========================
   링크 박스
   =========================== */
.link-box {
  text-align: center;
  margin-top: 20px;
}

.link-box a {
  color: #666;
  font-size: 14px;
  text-decoration: underline;
  transition: color 0.3s;
}

.link-box a:hover {
  color: #333;
}

/* ===========================
   프로필 업로드 & 사진
   =========================== */
.profile-upload {
  text-align: center;
  margin: 24px 0;
}

.profile-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #999;
  margin: 0 auto 12px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.profile-placeholder:hover {
  background-color: #e0e0e0;
}

.profile-center {
  display: flex;
  justify-content: center;
  margin: 24px 0;
}

.profile-photo {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  overflow: hidden;
}

.profile-photo .badge {
  position: absolute;
  bottom: 0;
  right: 0;
  background-color: #FEE500;
  color: #333;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ===========================
   게시글 목록 스타일
   =========================== */
.post-list-page p {
  font-size: 18px;
  margin-bottom: 16px;
  text-align: center;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.post {
  background-color: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.post:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.post h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.post .meta {
  font-size: 12px;
  color: #999;
  margin-bottom: 12px;
}

.post .preview {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===========================
   게시글 상세 스타일
   =========================== */
.post-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #333;
}

.meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  color: #666;
  margin-bottom: 16px;
}

.author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #ddd;
  display: inline-block;
}

.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.image-box {
  width: 100%;
  height: 300px;
  background-color: #f0f0f0;
  border-radius: 8px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
}

.post-body {
  font-size: 16px;
  line-height: 1.8;
  color: #333;
  margin: 20px 0;
}

.stats {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  margin: 20px 0;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: #f8f8f8;
  border-radius: 20px;
  font-size: 14px;
}

.stat-pill strong {
  font-weight: 600;
  color: #333;
}

.stat-pill span {
  color: #666;
}

/* ===========================
   댓글 스타일
   =========================== */
.comment-editor {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

.comment-list {
  margin-top: 24px;
}

.comment {
  background-color: #f9f9f9;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.comment-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #666;
}

.comment > div:last-child {
  font-size: 14px;
  color: #333;
  line-height: 1.6;
}

/* ===========================
   반응형 디자인
   =========================== */
@media (max-width: 768px) {
  header, .header, .app-header {
    padding: 12px 16px;
  }

  .container, main.container {
    padding: 20px 16px;
  }

  .card {
    padding: 16px;
  }

  .post-title {
    font-size: 20px;
  }

  .inline-actions {
    flex-direction: column;
    gap: 4px;
  }

  .stats {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  header h1, .header h1, .app-header h1 {
    font-size: 18px;
  }

  .btn {
    font-size: 14px;
    padding: 12px 20px;
  }

  .profile-placeholder, .profile-photo {
    width: 100px;
    height: 100px;
    font-size: 40px;
  }
}

/* ===========================
   좋아요 애니메이션
   =========================== */
.like-pill {
  transition: all 0.3s ease;
  user-select: none;
}

.like-pill:hover {
  transform: scale(1.05);
}

.like-pill:active {
  transform: scale(0.95);
}

.like-pill.liked {
  animation: likeHeartBeat 0.5s ease;
}

@keyframes likeHeartBeat {
  0% { transform: scale(1); }
  25% { transform: scale(1.2); }
  50% { transform: scale(1.1); }
  75% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.like-pill .like-icon {
  display: inline-block;
  font-size: 18px;
  margin-right: 4px;
  transition: transform 0.2s ease;
}

.like-pill.liked .like-icon {
  animation: heartPulse 0.6s ease;
}

@keyframes heartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ===========================
   푸터 스타일
   =========================== */
.app-footer {
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  font-size: 14px;
}
