/* 모던 스타일시트 */
:root {
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --success-color: #4cc9f0;
  --info-color: #4895ef;
  --warning-color: #f72585;
  --danger-color: #f71735;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --background-color: #ffffff;
  --text-color: #333333;
  --border-radius: 8px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body {
  font-family: 'Poppins', 'Noto Sans KR', sans-serif;
  background-color: #f5f8fa;
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto; /* 푸터를 아래로 밀기 위해 flex 속성 수정 */
}

/* 헤더 스타일 */
.site-header {
  margin-bottom: 0;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
  background-color: #fff;
}

.navbar {
  padding: 0.8rem 0;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
}

.navbar-brand img {
  max-height: 40px;
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: color 0.2s;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: #fff;
}

/* 메인 컨테이너 */
.main-content {
  flex: 1;
  padding: 1rem 0;
}

/* 푸터 스타일 */
.site-footer {
  background-color: #222838;
  color: #fff;
  padding: 3rem 0 2rem;
  margin-top: 3rem;
  width: 100%; /* 전체 너비 사용 */
  max-width: 100%; /* 최대 너비 제한 제거 */
  box-sizing: border-box; /* 패딩을 너비에 포함 */
  left: 0; /* 왼쪽에 딱 붙이기 */
  right: 0; /* 오른쪽에 딱 붙이기 */
}

.site-footer h5 {
  font-weight: 600;
  margin-bottom: 1.2rem;
  color: #fff;
}

.site-footer a {
  color: rgba(255,255,255,0.7);
  transition: color 0.2s;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: none;
}

.site-footer .social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.1);
  margin-right: 0.5rem;
  transition: all 0.3s ease;
}

.site-footer .social-links a:hover {
  background-color: var(--primary-color);
  transform: translateY(-3px);
}

/* 카드 스타일 */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 1.25rem 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

.card-img-top {
  height: 180px;
  object-fit: cover;
}

/* 링크 카드 */
.link-card {
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.link-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.link-thumbnail {
  height: 160px;
  overflow: hidden;
  position: relative;
  background-color: #f8f9fa;
}

.link-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.link-card:hover .link-thumbnail img {
  transform: scale(1.05);
}

.link-title {
  color: #333;
  text-decoration: none;
  font-weight: 600;
}

.link-title:hover {
  color: #1a57e3;
}

.link-description {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 4.5em;
}

/* 카테고리 스타일 */
.category-title {
  position: relative;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  color: #333;
}

.category-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px;
}

/* 카테고리 박스 스타일 재정의 - 그림자 제거 */
.category-box {
  padding: 1.5rem;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: none !important; /* 그림자 효과 완전히 제거 */
  transition: all 0.3s ease;
  height: 100%;
  position: relative;
  overflow: hidden;
  border: 1px solid #eaeaea; /* 그림자 대신 경계선 추가 (선택 사항) */
}

/* 호버 시 그림자 효과도 제거 */
.category-box:hover {
  transform: none; /* 올라가는 효과도 제거 */
  box-shadow: none !important;
}

/* 메인 검색 박스 - 현대적인 디자인으로 개선 */
.search-box {
  background: #fff;
  padding: 2rem;
  border-radius: var(--border-radius);
  margin-bottom: 2.5rem;
  box-shadow: var(--box-shadow);
}

.search-box h2 {
  font-weight: 700;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #333;
}

.search-box p {
  margin-bottom: 1.5rem;
  color: #666;
}

.search-box .form-control {
  border: 2px solid #eaeaea;
  border-radius: 50px;
  height: 54px;
  padding: 0 1.5rem;
  box-shadow: none;
  transition: all 0.3s;
}

.search-box .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.1);
}

.search-box .btn {
  height: 54px;
  border-radius: 50px;
  padding: 0 2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  transition: all 0.3s;
}

.search-box .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.search-box .btn i {
  margin-right: 8px;
  font-size: 1.1em;
}

/* 버튼 스타일 개선 */
.btn {
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  transition: all 0.3s;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.25);
}

.btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: white;
}

/* 반응형 디자인 개선 */
@media (max-width: 768px) {
  .navbar-nav .dropdown-menu {
    position: absolute;
  }
  
  .search-box {
    padding: 1.5rem;
  }
  
  .search-box h2 {
    font-size: 1.5rem;
  }
  
  .card-img-top {
    height: 140px;
  }
  
  .site-footer {
    text-align: center;
  }
  
  .footer-nav {
    text-align: center;
    margin-top: 1rem;
  }
  
  .category-card h5 {
    font-size: 1.1rem;
  }
}

/* 모바일 최적화 */
@media (max-width: 767px) {
  .link-thumbnail {
    height: 140px;
  }
  
  .card-title {
    font-size: 1.1rem;
  }
  
  .link-description {
    -webkit-line-clamp: 2;
    height: 3em;
  }
}

/* 배지 스타일 개선 */
.badge {
  font-weight: 500;
  padding: 0.4em 0.8em;
  border-radius: 30px;
}

/* 로딩 스피너 */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

/* 애니메이션 효과 */
.fade-in {
  animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 소셜 아이콘 스타일 개선 */
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  margin-right: 0.8rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.social-icon:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.social-icon i {
  font-size: 1.1rem;
}

/* Font Awesome 아이콘 수정 */
.fas, .far, .fab, .fa {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
  font-weight: 900;
}

.far {
  font-weight: 400 !important;
}

.fab {
  font-family: "Font Awesome 6 Brands" !important;
}

/* 광고 컨테이너 스타일 */
.ad-container {
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* 광고가 컨테이너를 벗어나지 않도록 */
}

.ad-container ins,
.ad-container iframe {
  margin: 0 auto; /* 광고 요소 자체도 중앙 정렬 */
  display: block;
}

/* 카테고리 페이지 그리드 뷰 스타일 개선 */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.links-grid .link-card {
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.links-grid .link-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.links-grid .thumbnail {
  height: 160px;
  overflow: hidden;
  position: relative;
  background-color: #f8f9fa;
}

.links-grid .thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.links-grid .link-card:hover .thumbnail img {
  transform: scale(1.05);
}

.links-grid .link-info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.links-grid .link-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.links-grid .link-info h3 a {
  color: #333;
  text-decoration: none;
  transition: color 0.2s;
}

.links-grid .link-info h3 a:hover {
  color: var(--primary-color, #1a57e3);
}

.links-grid .link-info p {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.links-grid .link-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #888;
}

.links-grid .link-meta span {
  display: flex;
  align-items: center;
}

.links-grid .link-meta i {
  margin-right: 5px;
}

/* 반응형 조정 */
@media (max-width: 767px) {
  .links-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
  }
}

@media (max-width: 575px) {
  .links-grid {
    grid-template-columns: 1fr;
  }
}

/* 리스트 뷰도 일관성 있게 스타일 추가 */
.links-list .list-group-item {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 8px !important;
  margin-bottom: 10px;
}

.links-list .list-group-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  z-index: 1;
}

.list-thumbnail {
  width: 80px;
  height: 80px;
  overflow: hidden;
}

.list-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 인기 웹사이트 썸네일 크기 제한 */
.popular-thumbnail {
    width: 60px;
    height: 60px;
    min-width: 60px;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid #eee;
}

.popular-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 태블릿 화면 크기 */
@media (min-width: 768px) {
    .popular-thumbnail {
        width: 70px;
        height: 70px;
        min-width: 70px;
    }
}

/* 데스크탑 화면 크기 */
@media (min-width: 992px) {
    .popular-thumbnail {
        width: 80px;
        height: 80px;
        min-width: 80px;
    }
}