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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  color: #333;
}

/* 네비게이션 */
.main-nav {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.logo a {
  color: #333;
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.3s ease;
}

.logo a:hover {
  color: #667eea;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  position: relative;
}

.nav-links a:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
}

/* 모바일 네비게이션 토글 버튼 */
.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: white;
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

.nav-links a.active {
  color: white;
  background: #667eea;
}

/* 메인 컨테이너 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 2rem 2rem;
}

/* 페이지 헤더 */
.page-header {
  text-align: center;
  margin-bottom: 3rem;
  color: #333;
  background: white;
  padding: 3rem 2rem;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #333;
  text-shadow: none;
}

.page-header p {
  font-size: 1.2rem;
  opacity: 0.8;
  color: #666;
  text-shadow: none;
}

/* 글 작성 버튼 */
.write-btn {
  display: inline-block;
  background: white;
  color: #333;
  padding: 1rem 2rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.write-btn:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 게시글 목록 */
.posts-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.posts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.posts-header h2 {
  color: #333;
  font-size: 1.5rem;
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.3s ease;
  cursor: pointer;
}

.post-item:hover {
  background: rgba(102, 126, 234, 0.05);
  transform: translateX(5px);
}

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

.post-info {
  flex: 1;
}

.post-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.post-title:hover {
  color: #667eea;
}

.post-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: #666;
}

.post-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: #666;
}

/* 모달 스타일 */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 2rem;
  border-bottom: 2px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 20px 20px 0 0;
}

.modal-header h2 {
  margin: 0;
}

.close {
  color: white;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.close:hover {
  opacity: 0.7;
}

.modal-body {
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 200px;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

.btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5a6fd8;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
  background: #f8f9fa;
  color: #666;
  border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
  background: #e9ecef;
  border-color: #ddd;
}

/* 게시글 상세 보기 */
.post-detail {
  padding: 2rem 0;
}

.post-detail-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.post-detail-title {
  font-size: 2rem;
  color: #333;
  margin-bottom: 1rem;
}

.post-detail-meta {
  display: flex;
  gap: 2rem;
  color: #666;
  font-size: 0.9rem;
}

.post-detail-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 3rem;
  white-space: pre-wrap;
}

/* 댓글 섹션 */
.comments-section {
  border-top: 2px solid #f0f0f0;
  padding-top: 2rem;
}

.comments-header {
  margin-bottom: 2rem;
  font-size: 1.3rem;
  color: #333;
}

.comment-form {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 15px;
  margin-bottom: 2rem;
}

.comment-item {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 15px;
  margin-bottom: 1rem;
}

.comment-author {
  font-weight: 600;
  color: #667eea;
  margin-bottom: 0.5rem;
}

.comment-content {
  color: #333;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.comment-date {
  font-size: 0.85rem;
  color: #666;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .container {
    padding: 90px 1rem 1rem;
  }

  .nav-container {
    padding: 0 1rem;
  }

  /* 모바일 네비게이션 */
  .nav-toggle {
    display: flex;
    position: relative;
    z-index: 1002;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: right 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
    padding: 2rem 0;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 15px;
    width: 80%;
    text-align: center;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
  }

  .nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
  }

  .page-header {
    padding: 2rem 1rem;
    margin-bottom: 1.5rem;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .page-header p {
    font-size: 1rem;
  }

  .posts-container {
    padding: 1.5rem;
  }

  .post-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
  }

  .post-info {
    width: 100%;
  }

  .post-stats {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .modal-content {
    width: 95%;
    margin: 2% auto;
    max-height: 95vh;
    overflow-y: auto;
    max-width: none;
  }

  .modal-header {
    padding: 1.5rem;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .form-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn {
    width: 100%;
  }

  /* 플로팅 버튼 모바일 조정 */
  #floatingAdminBtn {
    bottom: 15px !important;
    right: 15px !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 1.2rem !important;
    z-index: 999 !important;
  }

  /* 네비게이션이 열렸을 때 플로팅 버튼 숨김 */
  .nav-links.active ~ #floatingAdminBtn {
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 480px) {
  .nav-links a {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
  }

  .logo a {
    font-size: 1.2rem;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .page-header p {
    font-size: 1rem;
  }
}

/* 로딩 애니메이션 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 빈 상태 */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #666;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #333;
}

.empty-state p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* 플로팅 관리자 버튼 */
#floatingAdminBtn {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  width: 60px !important;
  height: 60px !important;
  border-radius: 50% !important;
  background: #667eea !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4) !important;
  cursor: pointer !important;
  font-size: 1.5rem !important;
  transition: all 0.3s ease !important;
  z-index: 2000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#floatingAdminBtn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6) !important;
  background: #5a6fd8 !important;
}

/* Quill 에디터 스타일 커스터마이징 */
.ql-editor {
  min-height: 200px;
  font-size: 14px;
  line-height: 1.6;
}

.ql-toolbar {
  border-top: 1px solid #ccc;
  border-left: 1px solid #ccc;
  border-right: 1px solid #ccc;
  background: #f8f9fa;
}

.ql-container {
  border-bottom: 1px solid #ccc;
  border-left: 1px solid #ccc;
  border-right: 1px solid #ccc;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.ql-editor.ql-blank::before {
  color: #999;
  font-style: normal;
  font-size: 14px;
}

/* 게시글 내용 스타일 */
.post-detail-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 3rem;
}

.post-detail-content h1,
.post-detail-content h2,
.post-detail-content h3 {
  margin: 1.5rem 0 1rem 0;
  color: #333;
}

.post-detail-content h1 {
  font-size: 1.8rem;
}
.post-detail-content h2 {
  font-size: 1.5rem;
}
.post-detail-content h3 {
  font-size: 1.3rem;
}

.post-detail-content p {
  margin-bottom: 1rem;
}

.post-detail-content blockquote {
  border-left: 4px solid #667eea;
  padding-left: 1rem;
  margin: 1rem 0;
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 4px;
}

.post-detail-content pre {
  background: #f4f4f4;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-family: "Courier New", monospace;
  border: 1px solid #ddd;
}

.post-detail-content ul,
.post-detail-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.post-detail-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}

.post-detail-content a {
  color: #667eea;
  text-decoration: none;
}

.post-detail-content a:hover {
  text-decoration: underline;
}

/* 페이지 전환 로딩 오버레이 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgb(255, 255, 255);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
  pointer-events: none;
}

.loading-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.loading-content {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.loading-video {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
  animation: float 3s ease-in-out infinite;
  background: white;
  border: 4px solid rgba(255, 255, 255, 0.8);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}
