body {
  font-family: 'Poppins', sans-serif;
  background-color: #f5f7fa !important;
  color: #222;
  font-size: 0.875rem; /* 14px */
  font-weight: 400;
  margin: 0 auto;
  padding: 0 !important;
  padding-top: 64px !important; /* PC: navbar 아래 첫 글이 가리지 않도록 */
  width: 100vw !important;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.bg-primary {
  --bs-bg-opacity: 1;
  background-color: #2b6cb0 !important;
}

.navbar-custom {
  background-color: #2b6cb0; /* Blue background color */
  transition: top 0.3s; /* Smooth transition for hiding and showing the navbar */
  font-size: 14px;
}

/* Navbar styles */
.navbar {
  background-color: #2b6cb0 !important;
  padding-top: 0.36rem;
  padding-bottom: 0.36rem;
}

.navbar .container-fluid {
  background-color: #2b6cb0 !important;
  padding: 0.36rem 1rem;
  margin: 0;
  width: 100%;
  display: flex;
  flex-wrap: inherit;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  color: white !important;
  padding: 0.22rem 0;
  margin-right: 1rem;
  font-size: 0.96rem;
  font-weight: 600;
}

/* Override Bootstrap's default styles */
.container-fluid {
  --bs-gutter-x: 0 !important;
  --bs-gutter-y: 0 !important;
  width: 100% !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  background-color: #2b6cb0 !important;
}

/* Remove all previous navbar styles */
.bg-primary,
.navbar-dark,
.navbar-expand-lg,
.navbar-custom {
  background-color: #2b6cb0 !important;
}

h1, h2 {
  text-align: center;
  font-size: 15px;
}

form {
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  margin: 0 auto 20px;
}

form input, form textarea {
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 5px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* 텍스트 에디터 스타일 */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px;
  background-color: #f8f9fa;
  border: 1px solid #ccc;
  border-radius: 5px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.editor-toolbar .btn {
  min-width: 36px;
  padding: 4px 8px;
  font-size: 12px;
}

.editor-content {
  min-height: 150px;
  max-height: 400px;
  overflow-y: auto;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
}

.editor-content:empty:before {
  content: attr(placeholder);
  color: #999;
  pointer-events: none;
}

.editor-content:focus {
  outline: none;
  border-color: #2b6cb0;
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.1);
}

form input:focus, form textarea:focus {
  outline: none;
  border-color: #2b6cb0;
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.1);
}

form input::placeholder,
form textarea::placeholder {
  color: #999;
  transition: all 0.2s ease;
}

form input:focus::placeholder,
form textarea:focus::placeholder {
  opacity: 0;
  transform: translateY(-10px);
}

form button {
  padding: 10px;
  font-size: 16px;
  border: none;
  background-color: #007BFF;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

form button:hover {
  background-color: #0056b3;
}

.guestbook-container {
  margin-top: 12px; /* PC: navbar와 첫 글 사이 간격 */
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  background-color: #f0f3f5; /* Dark blue background color */
  position: relative;
}

#write-post-button {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  outline: none !important;
  background: #f0f3f5 !important;
  color: #2b6cb0 !important;
  border: none !important;
  border-radius: 5px !important;
  margin-left: 0 !important;
  margin-right: auto !important;
  margin-top: 20px !important;
  margin-bottom: 20px !important;
  width: 100px !important;
  height: 40px !important;
  font-size: 14px !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

#write-post-button:hover {
  background: #2b6cb0 !important;
  color: #f0f3f5 !important;
  transform: translateY(-1px);
}

#write-post-button:active {
  transform: translateY(0);
}

#refresh-button {
  transition: all 0.2s ease;
}

#refresh-button:hover {
  transform: rotate(180deg);
}

#write-post-button::before {
  content: "✏️";
  font-size: 20px;
}

/* 모바일에서 Write 버튼이 확실히 보이도록 */
@media (max-width: 767px) {
  #write-post-button {
    width: 80px !important;
    height: 35px !important;
    font-size: 12px !important;
    background: #f0f3f5 !important;
    color: #007bff !important;
    border: none !important;
    border-radius: 5px !important;
    display: block !important;
    margin: 10px 0 !important;
    position: relative !important;
    z-index: 999 !important;
    opacity: 1 !important;
    visibility: visible !important;
    outline: none !important;
  }
  
  #write-post-button::before {
    content: "✏️";
    font-size: 16px !important;
    display: block !important;
  }
}

#write-post-button:hover::after {
  content: "Write";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: #f0f3f5 ;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  margin-top: 5px;
}

#write-post-container {
  max-width: 1400px;
  background-color: #f0f3f5 ; /* Dark blue background color */
  padding: 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  margin-top: 20px;
  position: relative;
  z-index: 10;
}

#write-post-container input,
#write-post-container textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #f0f3f5 ;
  border-radius: 5px;
  margin-bottom: 10px;
}

#write-post-container #message {
  height: 500px !important;
  min-height: 500px !important;
  max-height: none !important;
  resize: vertical !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

#write-post-container button {
  width: 100%;
  background-color: #007bff;
  color: #f0f3f5 ;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

th, td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: #f0f3f5; /* Dark blue background color */
}

th.title {
  width: 30%;
  text-align: center;
}

th.number, th.author, th.date, th.views {
  font-size: 12px;
}

th.actions {
  width: 20%;
}

.btn-danger {
  background-color: #d9534f; /* Delete 버튼의 배경 색상 */
  border: none; /* 버튼의 테두리 제거 */
  color: white; /* 버튼 텍스트 색상 */
  padding: 6px 12px; /* 버튼 패딩 */
  text-align: center; /* 텍스트 정렬 */
  text-decoration: none; /* 텍스트 밑줄 제거 */
  display: inline-block; /* 인라인 블록 요소로 설정 */
  font-size: 12px; /* 폰트 크기 */
  margin: 2px; /* 버튼 간격 */
  cursor: pointer; /* 커서 모양 변경 */
  border-radius: 4px; /* 둥근 테두리 */
}

.btn-warning {
  background-color: #f0ad4e; /* Edit 버튼의 배경 색상 */
  border: none; /* 버튼의 테두리 제거 */
  color: white; /* 버튼 텍스트 색상 */
  padding: 6px 12px; /* 버튼 패딩 */
  text-align: center; /* 텍스트 정렬 */
  text-decoration: none; /* 텍스트 밑줄 제거 */
  display: inline-block; /* 인라인 블록 요소로 설정 */
  font-size: 12px; /* 폰트 크기 */
  margin: 2px; /* 버튼 간격 */
  cursor: pointer; /* 커서 모양 변경 */
  border-radius: 4px; /* 둥근 테두리 */
}

.btn-danger2 {
  background-color: #858c92; /* Admin 버튼의 배경 색상 */
  border: none; /* 버튼의 테두리 제거 */
  color: white; /* 버튼 텍스트 색상 */
  padding: 6px 12px; /* 버튼 패딩 */
  text-align: center; /* 텍스트 정렬 */
  text-decoration: none; /* 텍스트 밑줄 제거 */
  display: inline-block; /* 인라인 블록 요소로 설정 */
  font-size: 12px; /* 폰트 크기 */
  margin: 2px; /* 버튼 간격 */
  cursor: pointer; /* 커서 모양 변경 */
  border-radius: 4px; /* 둥근 테두리 */
  display: none;
}

#edit-message {
  height: 200px !important; /* Adjust this value to set the desired height */
  padding: 10px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #ffffff; /* Background color */
  resize: vertical; /* Allows the user to resize the textarea vertically */
}

#write-post-container h3.text-primary {
  font-size: 18px !important;
}

/* Mobile styles */
@media (max-width: 767px) {
  body {
    padding: 10px;
    padding-top: 52px !important; /* navbar 바로 아래, 간격 최소화 */
    margin-top: 0 !important;
    font-size: 10px; /* 더 작게 조정 */
  }

  h1 {
    font-size: 14px; /* 더 작게 조정 */
    margin-bottom: 8px;
  }

  #post-container {
    max-width: 100%;
    padding: 8px;
    margin-top: 12px !important;
  }

  #post-header {
    margin-top: 20px;
  }

  #post-title {
    font-size: 16px; /* 더 작게 조정 */
  }

  #post-meta {
    font-size: 8px; /* 더 작게 조정 */
  }

  #post-content {
    font-size: 10px; /* 더 작게 조정 */
  }

  form {
    max-width: 90%;
    padding: 0;
    margin: 0 auto;
    font-size: 10px; /* 더 작게 조정 */
  }

  form input,
  form textarea {
    padding: 4px;
    margin: 4px 0;
    font-size: 8px;
  }

  form button {
    padding: 6px 8px;
    margin: 4px 0;
    font-size: 8px; /* 더 작게 조정 */
  }

  .guestbook-container {
    max-width: 95%;
    padding: 4px;
    margin: 0 auto;
    font-size: 8px; /* 더 작게 조정 */
  }

  #write-post-container, .guestbook-container {
    max-width: auto;
    font-size: 8px; /* 더 작게 조정 */
  }

  table, th, td {
    font-size: 8px; /* 더 작게 조정 */
    padding: 4px;
  }

  .btn-danger, .btn-warning, .btn-danger2 {
    padding: 3px 6px;
    font-size: 8px; /* 더 작게 조정 */
    margin: 1px;
  }

  #write-post-button {
    width: 80px; /* 모바일에서도 보이도록 크게 조정 */
    height: 35px; /* 모바일에서도 보이도록 크게 조정 */
    font-size: 12px; /* 모바일에서도 보이도록 크게 조정 */
    background: #f0f3f5  !important;
    color: #007bff !important;
    border: 2px solid #007bff !important;
    border-radius: 5px !important;
    display: block !important;
    margin: 10px auto !important;
  }

  .item-title a {
    font-size: 0.9rem; /* 더 작게 조정 */
  }

  .item-meta {
    font-size: 0.8rem; /* 더 작게 조정 */
  }

  .item-number {
    font-size: 0.85rem; /* 더 작게 조정 */
  }

  .sliders-container,
  .btn-danger2 {
    display: none;
  }
}

.guestbook-item {
  border-bottom: 1px dashed #e0e4e8;
  padding: 12px 0 6px 0;
  transition: background-color 0.2s ease;
}

.guestbook-item:hover {
  background-color: rgba(43, 108, 176, 0.05);
  border-radius: 4px;
  padding-left: 8px;
  padding-right: 8px;
  margin-left: -8px;
  margin-right: -8px;
}
.item-title {
  overflow: hidden;
  min-width: 0;
}
.item-title a {
  font-size: 0.95rem;
  font-weight: 500;
  color: #222;
  text-decoration: none;
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-title a:hover {
  color: #2b6cb0;
  text-decoration: underline;
}
.item-meta {
  font-size: 0.95rem;
  font-weight: 400;
  color: #666;
  margin-top: 2px;
}
.item-meta span {
  margin-right: 12px;
}

.item-number {
  font-weight: bold;
  color: #2b6cb0;
  margin-right: 8px;
  font-size: 1.05rem;
}

.item-author {
  margin-left: 0;
}

.guestbook-list {
  margin-top: 0.5rem;
  /* 성능 최적화: GPU 가속 */
  will-change: contents;
  transform: translateZ(0);
}

/* 로딩 스피너 애니메이션 최적화 */
.loading-spinner {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 에러 메시지 스타일 */
.error-message {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#write-post-button,
#write-post-button:focus,
#write-post-button:active,
#write-post-button:hover {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

#post-container {
  width: calc(100% + 40px) !important;
  max-width: calc(100% + 40px) !important;
  margin-left: -20px !important;
  margin-right: -20px !important;
}

#post-content {
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

#post-message {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

#post-container,
#post-content,
#post-message {
  width: 100vw !important;
  max-width: 100vw !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}

#write-post-button {
  margin-top: 1rem !important;
}

@media (max-width: 767px) {
  #write-post-button {
    background: #f0f3f5  !important;
  }
  
  /* 모바일에서 모달이 상단에 잘 보이도록 */
  #write-post-modal .modal-dialog {
    margin: 0 !important;
    max-width: 100% !important;
    height: 100vh !important;
    display: flex !important;
    align-items: flex-start !important;
  }
  
  #write-post-modal .modal-content {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    min-height: 100vh !important;
    margin-top: 48px !important; /* 모바일 navbar 높이만큼 */
  }
  
  #write-post-modal .modal-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background-color: white !important;
  }
  
  #write-post-modal .modal-body {
    overflow-y: auto !important;
    max-height: calc(100vh - 120px) !important;
    padding: 15px !important;
  }
  
  #write-post-modal .modal-body .form-control,
  #write-post-modal .modal-body .editor-content {
    font-size: 16px !important; /* 모바일에서 자동 줌 방지 */
  }
}







