:root {
  --bg-color: #f8f9fa;
  --text-color: #333;
  --accent-color: #2c3e50;
  --secondary-text: #666;
  --white: #ffffff;
  --border-color: #e1e4e8;
  --container-width: 1200px;
  --spacing-unit: 1rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans KR", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s;
}

ul {
  list-style: none;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-unit);
}

/* Header */
.main-header {
  background-color: var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 102;
}

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: -0.5px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.menu-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-links li a {
  text-decoration: none;
  color: var(--accent-color);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.menu-links li a:hover {
  color: #6c63ff;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a,
.admin-login-btn {
  font-size: 1.2rem;
  color: var(--secondary-text);
}

.social-links a:hover,
.admin-login-btn:hover {
  color: var(--accent-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}

.mobile-menu-toggle span {
  width: 100%;
  height: 3px;
  background-color: var(--accent-color);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background-color: var(--white);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0;
    padding: 80px 2rem 2rem;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 100;
  }

  .main-nav.active {
    left: 0;
  }

  .menu-links {
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin-bottom: 2rem;
  }

  .menu-links li {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }

  .menu-links li a {
    display: block;
    padding: 1rem 0;
    font-size: 1.1rem;
  }

  .social-links {
    width: 100%;
    justify-content: flex-start;
    gap: 1.5rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
  }

  .admin-login-btn {
    font-size: 1.3rem;
  }

  /* Mobile Overlay */
  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
  }

  .mobile-menu-overlay.active {
    display: block;
  }
}

/* Hero Section */
.hero-section {
  padding: 4rem 0;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  border-bottom: 1px solid var(--border-color);
}

.hero-section h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--accent-color);
}

.hero-section p {
  color: var(--secondary-text);
  font-size: 1.1rem;
}

/* Profile Section */
.profile-section {
  padding: 3rem 0;
  background-color: var(--white);
  margin-bottom: 2rem;
}

.profile-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
}

.profile-image {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.profile-image .img-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #ddd;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #888;
  font-weight: bold;
  font-size: 0.9rem;
}

.profile-text h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.profile-text p {
  color: var(--secondary-text);
  max-width: 600px;
  margin: 0 auto;
}

/* Content Grid Section */
.content-grid-section {
  padding-bottom: 4rem;
}

.grid-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.grid-item {
  background-color: var(--white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 200px;
  border: 1px solid transparent;
}

.grid-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  border-color: var(--border-color);
}

/* 각 섹션별 포인트 컬러 (선택사항) */
.item-aiworld {
  border-top: 4px solid #3498db;
}
.item-works {
  border-top: 4px solid #e74c3c;
}
.item-vision {
  border-top: 4px solid #f1c40f;
}
.item-skillup {
  border-top: 4px solid #2ecc71;
}

.grid-item h3 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.grid-item p {
  color: var(--secondary-text);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.btn-link {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-color);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* 관리자 버튼 스타일 */
.btn-admin {
  padding: 0.5rem 1rem;
  background: #2c3e50;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-left: 0.5rem;
}

.btn-admin:hover {
  background: #1a252f;
}

.btn-admin.delete {
  background: #e74c3c;
}

.btn-admin.delete:hover {
  background: #c0392b;
}

/* 푸터 */
.main-footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--secondary-text);
  font-size: 0.9rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--white);
}

/* Responsive Media Queries */
@media (min-width: 768px) {
  /* Tablet & Desktop */
  .profile-wrapper {
    flex-direction: row;
    text-align: left;
    justify-content: center;
  }

  .profile-text p {
    margin: 0;
  }

  .grid-container {
    grid-template-columns: repeat(2, 1fr); /* 2열 배치 */
  }
}

@media (min-width: 1024px) {
  /* Large Desktop */
  .hero-section {
    padding: 6rem 0;
  }

  /* 필요시 4열 배치로 변경하려면 아래 주석 해제 */
  /* .grid-container { grid-template-columns: repeat(4, 1fr); } */
}

/* =========================================
   Board Page (List) Styles
   ========================================= */

.sub-hero {
  background-color: var(--white);
  padding: 3rem 0 2rem;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  border-bottom: 1px solid var(--border-color);
}

.category-title {
  font-size: 2rem;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.category-desc {
  color: var(--secondary-text);
}

.board-section {
  padding: 3rem 0;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-item {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.post-thumb {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 6px;
  overflow: hidden;
}

.post-thumb .img-placeholder {
  width: 100%;
  height: 100%;
  background-color: #eee;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #999;
  font-size: 0.8rem;
}

.post-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.post-title {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.post-summary {
  color: var(--secondary-text);
  font-size: 0.95rem;
  margin-bottom: auto; /* 날짜를 바닥으로 밀기 위함 */
  line-height: 1.5;

  /* 2줄 이상 말줄임 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #999;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--white);
  color: var(--secondary-text);
  font-size: 0.9rem;
}

.page-btn:hover,
.page-btn.active {
  background-color: var(--accent-color);
  color: var(--white);
  border-color: var(--accent-color);
}

/* =========================================
   View Page (Detail) Styles
   ========================================= */

.view-section {
  padding: 3rem 0;
}

.view-container {
  max-width: 800px; /* 본문 집중도를 위해 폭 제한 */
  background-color: var(--white);
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.view-header {
  text-align: left;
  margin-bottom: 1.5rem;
}

.category-badge {
  display: inline-block;
  background-color: #f1f3f5;
  color: var(--accent-color);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.view-title {
  font-size: 2rem;
  line-height: 1.3;
  margin-bottom: 1rem;
  word-break: keep-all;
}

.view-meta {
  color: #999;
  font-size: 0.9rem;
}

.divider {
  border: 0;
  height: 1px;
  background-color: #eee;
  margin: 2rem 0;
}

.view-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #444;
}

.view-content p {
  margin-bottom: 1.5rem;
}

.content-img-wrapper,
.content-media-wrapper {
  text-align: center;
  margin: 2rem 0;
}

.img-caption {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #888;
}

.view-nav {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

.btn-list {
  padding: 0.8rem 2rem;
  background-color: var(--accent-color);
  color: var(--white);
  border-radius: 6px;
  font-weight: 700;
  transition: background-color 0.3s;
}

.btn-list:hover {
  background-color: #1a252f;
}

/* Responsive for Board/View */
@media (max-width: 768px) {
  .post-item {
    flex-direction: column;
    gap: 1rem;
  }

  .post-thumb {
    width: 100%;
    height: 180px;
  }

  .view-container {
    padding: 1.5rem;
  }

  .view-title {
    font-size: 1.6rem;
  }
}

/* =========================================
   Custom UI (Toast, Modal) Styles
   ========================================= */

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background-color: rgba(44, 62, 80, 0.95);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  opacity: 0;
  transform: translateY(-20px);
  animation: toastSlideIn 0.3s forwards;
}

.toast.success {
  border-left: 4px solid #2ecc71;
}
.toast.error {
  border-left: 4px solid #e74c3c;
}
.toast.info {
  border-left: 4px solid #3498db;
}

@keyframes toastSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastFadeOut {
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Custom Modal */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(2px);
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

.custom-modal {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 400px;
  transform: scale(0.9);
  animation: scaleUp 0.3s forwards;
  text-align: center;
}

.custom-modal h3 {
  margin-bottom: 1rem;
  color: var(--accent-color);
}

.custom-modal p {
  margin-bottom: 1.5rem;
  color: var(--secondary-text);
}

.custom-modal input {
  width: 100%;
  padding: 10px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
}

.custom-modal input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.btn-modal {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-modal.confirm {
  background-color: var(--accent-color);
  color: #fff;
}

.btn-modal.confirm:hover {
  background-color: #1a252f;
}

.btn-modal.cancel {
  background-color: #f1f3f5;
  color: #333;
}

.btn-modal.cancel:hover {
  background-color: #e9ecef;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}
@keyframes scaleUp {
  to {
    transform: scale(1);
  }
}
