/* AdminLTE v3 공식 데모 스타일 - 추가 커스터마이징 없음 */

/* 모바일 반응형 스타일 추가 */

/* 모바일 테이블 최적화 */
@media (max-width: 768px) {
  /* 테이블 반응형 스크롤 개선 */
  .table-responsive {
    font-size: 0.85rem;
  }
  
  /* 뉴스 제목 줄바꿈 및 최대 너비 설정 */
  .table td:nth-child(3) {
    max-width: 200px;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
  }
  
  /* 버튼 크기 조정 */
  .btn-sm {
    padding: 0.25rem 0.4rem;
    font-size: 0.75rem;
  }
  
  /* 필터 버튼 그룹 모바일 최적화 */
  .btn-group .btn {
    margin-bottom: 2px;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
  
  /* 카드 패딩 조정 */
  .card-body {
    padding: 0.75rem;
  }
  
  /* 페이지네이션 버튼 크기 조정 */
  .pagination .page-link {
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
  }
  
  /* 테이블 헤더 숨기기 (일부) */
  .table th:first-child,
  .table td:first-child {
    display: none;
  }
}

/* 모달 높이 동적 조정 */
.modal-xl {
  max-width: 90%;
}

.modal-body {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

/* iframe 반응형 높이 - 데스크톱용 */
.embed-responsive-item {
  min-height: 500px;
  height: calc(100vh - 200px);
  max-height: none;
}

/* 모바일 모달 최적화 - 전체화면 스타일 */
@media (max-width: 768px) {
  .modal-xl {
    max-width: 100%;
    margin: 0;
    height: 100vh;
  }
  
  .modal-content {
    height: 100vh;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
  }
  
  .modal-body {
    padding: 0;
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }
  
  .modal-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
  }
  
  .modal-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #dee2e6;
    flex-shrink: 0;
  }
  
  .news-iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
    flex: 1;
    display: block;
  }
  
  #newsContent {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
}

@media (max-width: 576px) {
  .modal-xl {
    max-width: 100%;
    margin: 0;
    height: 100vh;
  }
  
  .modal-content {
    height: 100vh;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
  }
  
  .modal-header {
    padding: 0.5rem 0.75rem;
    min-height: 50px;
    flex-shrink: 0;
  }
  
  .modal-title {
    font-size: 0.9rem;
    word-break: break-word;
    line-height: 1.2;
  }
  
  .modal-body {
    padding: 0;
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }
  
  .modal-footer {
    padding: 0.5rem 0.75rem;
    min-height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
  }
  
  .modal-footer .btn {
    min-height: 40px;
    font-size: 0.85rem;
  }
  
  .news-iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
    flex: 1;
    display: block;
  }
  
  #newsContent {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  
  /* 필터 섹션 스택 레이아웃 */
  .row.mb-3 .col-md-4 {
    margin-bottom: 1rem;
  }
  
  /* 표시 개수 선택 왼쪽 정렬 */
  .col-md-4.text-right {
    text-align: left !important;
  }
}

/* 추가 모바일 최적화 */
@media (max-width: 480px) {
  /* 더 작은 모바일 디바이스 최적화 */
  .card-title {
    font-size: 1.1rem;
  }
  
  /* 버튼 텍스트 축약 */
  .btn .fas {
    margin-right: 2px;
  }
  
  /* 테이블 셀 패딩 조정 */
  .table td, .table th {
    padding: 0.5rem 0.25rem;
  }
  
  /* 모달 footer 버튼 스택 */
  .modal-footer {
    flex-direction: column;
  }
  
  .modal-footer .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .modal-footer .btn:last-child {
    margin-bottom: 0;
  }
}