*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Pretendard', sans-serif;
  background-color: #f5f6fa;
  margin: 0;
  padding: 0;
}

/* ✅ 헤더 정렬 개선 */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 20px;
}

header h1 {
  font-size: 1.8rem;
  color: #333;
}

header h1 br {
  display: none;
}

.auth-area {
  display: flex;
  align-items: center;
  gap: 6px; /* ✅ 버튼 사이 간격 넓힘 */
}

/* 기본 버튼 스타일 */
button {
  padding: 8px 14px;
  border: 1px solid #d1d5db; /* 약한 회색 보더 */
  border-radius: 8px;
  background: #fff;           /* 흰색 베이스 */
  color: #333;                /* 글씨 진회색 */
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

button:hover {
  background: #f9fafb; /* 미세한 회색톤 */
  border-color: #cbd5e1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

button:active {
  background: #f3f4f6;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* 게시글 작성 버튼 */
.write-btn {
  background: #fff !important;
  border: 1px solid #d1d5db !important;
  color: #333 !important;
}
.write-btn:hover {
  background: #f9fafb !important;
}

/* 학과별 피드보드 */
.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  padding: 0 20px 60px;
  width: 95vw;
  margin: 0 auto;
  align-items: start;
}

.column {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.column h2 {
  background: #f3f4f6;              /* 아주 옅은 회색 */
  color: #111827;                   /* 진한 회색 글씨 */
  border: 1px solid #e5e7eb;        /* 미세한 보더 */
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  padding: 10px 0;
  margin: 0;
  text-align: center;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.column h2:hover {
  background: #e5e7eb;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

#quillEditor {
  margin-bottom: 10px;
}

#loginBtn,
#logoutBtn,
#deleteImageBtn,
.deleteBtn,
.editBtn {
  background: #fff !important;
  color: #333 !important;
}

.editBtn {
  color: #3b82f6 !important;
}
.deleteBtn {
  color: coral !important;
}

#loginBtn:hover,
#logoutBtn:hover,
#deleteImageBtn:hover,
.deleteBtn:hover,
.editBtn:hover {
  background: #f9fafb !important;
}

/* 학과별 색상 */
.뷰티스마트케어과 h2,
.부사관과 h2,
.글로벌경영과 h2,
.회계정보과 h2,
.창업마케팅과 h2,
.AI게임콘텐츠과 h2,
.소프트웨어개발과 h2,
.금융경영과 h2 {
  background: #f3f4f6 !important;
  color: #111827 !important;
}

/* 카드 디자인 */
.card {
  background: #f9fafb;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid #e5e7eb;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
}
.card img {
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: cover;
  object-position: center;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 8px;
}
.card-content {
  padding: 12px 14px 16px;
}
.card-content h3 {
  font-size: 0.95rem;
  color: #222;
  margin: 6px 0 8px;
}
.card-content .content {
  font-size: 0.85rem;
  color: #444;
  line-height: 1.5;
  margin: 0;
}
.card-content .content p {
  margin: 3px;
}
.card-content .content ul {
  margin-top: 2px;
  padding-left: 20px;
}

.author {
  font-size: 0.75rem;
  color: #777;
  text-align: right;
  margin-top: 8px;
  border-top: 1px dashed #ddd;
  padding-top: 6px;
}

.card .actions {
  text-align: right;
  margin-top: 6px;
  font-size: 0.8rem;
}

.card .actions button {
  background: none;
  border: none;
  color: #3b82f6;
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0;
  margin-left: 6px;
  transition: color 0.2s ease;
}

.card .actions button:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

/* ✅ 게시글 작성 폼 버튼 간격 */
#uploadWidgetBtn,
#deleteImageBtn {
  margin-bottom: 10px;
}

#postForm button {
  width: 100%;
  box-sizing: border-box; 
}

/* ✨ 모달(팝업) 스타일 */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.modal-content {
  background: #fff;
  padding: 20px 25px;
  border-radius: 14px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.close {
  position: absolute;
  right: 16px;
  top: 12px;
  font-size: 1.5rem;
  color: #444;
  cursor: pointer;
}
.modal-content input,
.modal-content select,
.modal-content textarea {
  width: 100%;
  margin: 6px 0 12px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
}
.modal-content button {
  width: 100%;
  padding: 10px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.modal-content button:hover {
  background: #2563eb;
}

/* ✅ 미리보기 이미지 */
#previewImage {
  display: none;
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ddd;
  margin-top: 6px;
}

/* ✅ Cropper.js 모달 스타일 */
.crop-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.crop-box {
  background: white;
  padding: 20px;
  border-radius: 12px;
  max-width: 90%;
  max-height: 90%;
  text-align: center;
}

.crop-box img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
}

.crop-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 12px; /* ✅ 버튼 간격 */
}

.crop-actions button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

#cropConfirmBtn {
  background: #3b82f6;
  color: white;
}
#cropCancelBtn {
  background: #aaa;
  color: white;
}

/* ✅ Quill 툴바: 완전 가로 한 줄로 정렬 */
.ql-toolbar.ql-snow {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;  /* ✅ 왼쪽 정렬 */
  overflow-x: auto;
  border: 1px solid #ccc;
  border-radius: 8px 8px 0 0;
  background: #fafafa;
  position: relative;
  z-index: 2001 !important;
  overflow: visible;
}

/* ✅ 툴바 안 아이콘 크기 키우기 */
.ql-toolbar.ql-snow button svg {
  width: 15px !important;
  height: 15px !important;
}

/* ✅ 각 그룹 간 여백 */
.ql-toolbar.ql-snow .ql-formats {
  margin: 0 !important;
  display: flex !important;
  justify-content: flex-start !important;
}

/* ✅ 팔레트도 툴바 기준으로 표시 */
.ql-toolbar .ql-picker-options {
  position: absolute !important;
  z-index: 2002 !important; /* 툴바보다 위 */
  top: 100% !important;
  left: 0;
}

/* ✅ 에디터 본문 */
.ql-container.ql-snow {
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 8px 8px;
  min-height: 200px;
  background: #fff;
  font-size: 15px;
  line-height: 1.6;
  transition: height 0.25s ease;
}

.ql-toolbar.ql-expanded {
  height: 90px; /* 필요에 따라 조절 */
}

/* Quill 구분선(hr) 스타일 */
.ql-toolbar .ql-hr {
  background: #fff;
  transition: 0.2s;
}
.ql-toolbar .ql-hr:hover {
  color: #3b82f6 !important;
}

.ql-container {
  cursor: text; /* 빈 곳 클릭 시 텍스트 입력 느낌 */
}

/* ✅ 로딩 스피너 */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  margin-right: 6px;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.auth-area {
  transition: opacity 0.3s ease;
}

.scroll-top-btn {
  position: fixed;
  bottom: 25px;
  right: 20px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background-color: rgba(59, 130, 246, 0.9);
  color: white;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  z-index: 999;
}
.scroll-top-btn:hover {
  background-color: rgba(37, 99, 235, 1);
  transform: translateY(-3px);
}
.scroll-top-btn.show {
  opacity: 1;
  visibility: visible;
}

/* ✅ 반응형 */
@media (max-width: 1600px) {
  .board { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1000px) {
  .board { grid-template-columns: repeat(2, 1fr); }
}

/* ✅ 기본 숨김 */
.dept-select {
  display: none;
  margin-top: 8px;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
  width: 100%;
}

/* ✅ 모바일 전용 */
@media (max-width: 768px) {
  .board { grid-template-columns: repeat(1, 1fr); }
  header {
    height: auto;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid #eee;
  }

  header h1 {
    font-size: 1.1rem;        /* 제목 크기 줄임 */
    font-weight: 600;
    margin: 0 0 6px 0;
    text-align: left;
  }

  header h1 br {
    display: inline;
  }

  .auth-area {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
  }

  .auth-area button,
  .auth-area select {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 6px;
    height: 28px;
    border: 1px solid #ccc;
    background: #f9f9f9;
    color: #333;
    transition: 0.2s ease;
  }

  /* ✅ hover 시 subtle 효과 */
  .auth-area button:hover,
  .auth-area select:hover {
    background: #f0f0f0;
  }

  /* ✅ 버튼 색상 구분 제거 */
  .auth-area button {
    background: #f9f9f9;
  }

  /* ✅ 셀렉트박스는 항상 표시 */
  .dept-select {
    display: block !important;
    font-size: 0.7em;
    color: #333;
    height: 28px;
    line-height: 28px;
  }
}
