/* 임고뉴스 페이지 전용 스타일 */

/* 메인 컨테이너 */
.news-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 12px 100px;
  margin-top: 48px;
}

/* 페이지 헤더 */
.page-header {
  text-align: center;
  margin-bottom: 32px;
  padding: 24px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: white;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

.page-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
}

.page-header p {
  margin: 0;
  font-size: 16px;
  opacity: 0.9;
}

/* 관리자 패널 */
.admin-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.admin-controls {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* 버튼 스타일 */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background: #4b5563;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

/* 검색 섹션 */
.search-section {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.search-bar input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}

.search-bar input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-btn {
  padding: 12px 20px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.search-btn:hover {
  background: #2563eb;
}

/* 필터 탭 */
.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tab:hover {
  background: #f3f4f6;
}

.filter-tab.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

/* 게시글 목록 */
.news-list {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.news-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background-color 0.2s ease;
  min-height: 50px;
}

.news-item:hover {
  background: #f8fafc;
}

.news-item:last-child {
  border-bottom: none;
}

.news-category {
  display: inline-block;
  min-width: 50px;
  text-align: center;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  margin-right: 10px;
}

.news-category.notice {
  color: #1f2937;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
}

.news-category.info {
  color: #1e40af;
  border: 1px solid #93c5fd;
  background: #eff6ff;
}

.news-category.event {
  color: #155e75;
  border: 1px solid #99f6e4;
  background: #ecfeff;
}

.news-category.tip {
  color: #166534;
  border: 1px solid #86efac;
  background: #f0fdf4;
}

.news-content {
  flex: 1;
}

.news-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 2px;
  line-height: 1.2;
}

.news-preview {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.news-date {
  font-size: 11px;
  color: #9ca3af;
}

.news-views {
  font-size: 10px;
  color: #9ca3af;
}

/* 관리자 액션 버튼 */
.news-actions {
  display: flex;
  gap: 8px;
  margin-left: 12px;
}

.news-actions .btn {
  padding: 6px 12px;
  font-size: 12px;
}

/* 페이지네이션 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination button:hover {
  background: #f3f4f6;
}

.pagination button.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 모달 스타일 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  overflow-y: auto;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 8px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
  border: 1px solid #e5e7eb;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  text-align: center;
  position: relative;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  flex: 1;
  text-align: center;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  position: absolute;
  right: 24px;
}

.close-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* 폼 스타일 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* 게시글 상세보기 */
.news-header {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.news-meta-horizontal {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.meta-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: auto;
  white-space: nowrap;
}

.meta-item:first-child {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: auto;
}

.meta-label {
  font-size: 10px;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.news-header .category {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.news-header .date,
.news-header .views {
  font-size: 11px;
  font-weight: 500;
  color: #374151;
}

.news-content-wrapper {
  background: white;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid #e5e7eb;
}

.news-content {
  line-height: 1.7;
  color: #374151;
  font-size: 15px;
}

.news-content h1,
.news-content h2,
.news-content h3,
.news-content h4,
.news-content h5,
.news-content h6 {
  color: #1f2937;
  margin: 20px 0 12px;
  font-weight: 600;
}

.news-content h1 { font-size: 22px; }
.news-content h2 { font-size: 18px; }
.news-content h3 { font-size: 16px; }

.news-content p {
  margin: 12px 0;
}

.news-content ul,
.news-content ol {
  margin: 12px 0;
  padding-left: 20px;
}

.news-content li {
  margin: 6px 0;
}

.news-content strong {
  color: #1f2937;
  font-weight: 600;
}

.news-content em {
  color: #6b7280;
  font-style: italic;
}

/* 관리자 로그인 버튼 */
.admin-login-btn {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  transition: all 0.2s ease;
  z-index: 1000;
}

.admin-login-btn:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* 로딩 상태 */
.loading {
  text-align: center;
  padding: 40px;
  color: #6b7280;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 빈 상태 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #374151;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
}

/* 파일 업로드 스타일 */
.file-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
  background: #f9fafb;
}

.file-upload-area:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.file-upload-area.dragover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: scale(1.02);
}

.file-upload-placeholder {
  cursor: pointer;
  padding: 20px;
}

.upload-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.file-upload-placeholder p {
  margin: 0 0 4px;
  font-weight: 600;
  color: #374151;
}

.file-upload-placeholder small {
  color: #6b7280;
  font-size: 12px;
}

.file-list {
  margin-top: 16px;
  text-align: left;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 8px;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.file-icon {
  font-size: 16px;
}

.file-name {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.file-size {
  font-size: 12px;
  color: #6b7280;
}

.file-remove {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.file-remove:hover {
  background: #dc2626;
}

/* 첨부파일 표시 스타일 */
.news-attachments {
  background: #f8fafc;
  border-radius: 8px;
  padding: 20px;
  margin-top: 24px;
  border: 1px solid #e2e8f0;
}

.attachments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.attachments-header h4 {
  margin: 0;
  font-size: 16px;
  color: #1f2937;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.attachment-count {
  background: #3b82f6;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  text-decoration: none;
  color: #374151;
  transition: all 0.2s ease;
}

.attachment-item:hover {
  background: #f8fafc;
  border-color: #3b82f6;
}

.attachment-icon {
  font-size: 20px;
  flex-shrink: 0;
  padding: 6px;
  background: #f1f5f9;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
}

.attachment-info {
  flex: 1;
}

.attachment-name {
  font-weight: 500;
  margin-bottom: 2px;
  color: #1f2937;
  font-size: 14px;
}

.attachment-meta {
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 8px;
}

.attachment-download {
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.attachment-download:hover {
  background: #2563eb;
}

/* 게시글 목록에 첨부파일 아이콘 표시 */
.news-item.has-attachments .news-title::after {
  content: " 📎";
  font-size: 12px;
  opacity: 0.7;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .news-container {
    padding: 16px 8px 100px;
  }
  
  .page-header {
    padding: 20px 16px;
  }
  
  .page-header h1 {
    font-size: 24px;
  }
  
  .search-bar {
    flex-direction: column;
  }
  
  .filter-tabs {
    justify-content: center;
  }
  
  .news-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .news-meta {
    align-self: flex-end;
    flex-direction: row;
  }
  
  .admin-controls {
    flex-direction: column;
  }
  
  .modal-content {
    margin: 10px;
    max-height: calc(100vh - 20px);
    max-width: calc(100vw - 20px);
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  /* 게시글 상세보기 반응형 */
  .news-meta-horizontal {
    flex-direction: row;
    gap: 16px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  
  .meta-item {
    flex-direction: row;
    align-items: center;
    gap: 4px;
    min-width: auto;
  }
  
  .meta-item:first-child {
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }
  
  .news-header {
    padding: 12px 16px;
  }
  
  .news-content-wrapper {
    padding: 16px;
  }
  
  .news-attachments {
    padding: 16px;
  }
  
  .attachment-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .attachment-download {
    align-self: stretch;
    text-align: center;
  }
  
  .modal-header {
    padding: 16px 20px;
  }
  
  .close-btn {
    right: 20px;
  }
  
  .modal-body {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .news-item {
    padding: 12px 16px;
  }
  
  .news-title {
    font-size: 14px;
  }
  
  .news-preview {
    font-size: 12px;
  }
  
  .admin-login-btn {
    bottom: 70px;
    right: 16px;
    width: 50px;
    height: 50px;
    font-size: 10px;
  }
}
