/* ============================================
   펫포털 - 메인 스타일시트
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #FF6B35;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ============================================
   Variables
   ============================================ */
:root {
  --primary-color: #FF6B35;
  --primary-dark: #E55A2B;
  --secondary-color: #4ECDC4;
  --accent-color: #FFE66D;
  --text-color: #333;
  --text-light: #666;
  --text-muted: #999;
  --bg-color: #f8f9fa;
  --bg-white: #fff;
  --border-color: #e0e0e0;
  --shadow: 0 2px 10px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
  --radius: 8px;
  --radius-lg: 12px;
  --header-height: 70px;
  --container-width: 1200px;
}

/* ============================================
   Container
   ============================================ */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   Header
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-white);
  box-shadow: var(--shadow);
  z-index: 1000;
}

.header-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.logo-icon {
  font-size: 1.8rem;
}

/* Navigation - Desktop */
.nav-desktop {
  display: block;
}

.nav-menu {
  display: flex;
  gap: 10px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  padding: 10px 20px;
  font-weight: 500;
  color: var(--text-color);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background: var(--primary-color);
  color: #fff;
}

/* Dropdown */
.has-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  z-index: 100;
}

.dropdown-menu li a {
  display: block;
  padding: 10px 20px;
  color: var(--text-color);
  transition: all 0.2s;
}

.dropdown-menu li a:hover {
  background: var(--bg-color);
  color: var(--primary-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  position: relative;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  width: 24px;
  height: 2px;
  background: var(--text-color);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: all 0.3s;
}

.menu-icon {
  top: 50%;
  transform: translate(-50%, -50%);
}

.menu-icon::before {
  content: '';
  top: -8px;
}

.menu-icon::after {
  content: '';
  top: 8px;
}

/* Mobile Navigation */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-white);
  z-index: 999;
  overflow-y: auto;
  padding: 20px;
}

.nav-mobile.active {
  display: block;
}

.mobile-menu-item {
  border-bottom: 1px solid var(--border-color);
}

.mobile-link {
  display: block;
  padding: 15px 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.mobile-submenu {
  padding-left: 20px;
  padding-bottom: 10px;
}

.mobile-submenu li a {
  display: block;
  padding: 10px 0;
  color: var(--text-light);
}

/* ============================================
   Main Content
   ============================================ */
.main {
  flex: 1;
  margin-top: var(--header-height);
  padding: 30px 0;
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  padding: 40px 20px;
  margin: -30px 0 30px;
  text-align: center;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.page-header p {
  opacity: 0.9;
  font-size: 1.1rem;
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-image {
  position: relative;
  padding-top: 75%;
  background: var(--bg-color);
  overflow: hidden;
}

.card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 16px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  font-size: 0.875rem;
  color: var(--text-light);
}

.card-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 20px;
  margin-right: 6px;
  margin-bottom: 6px;
}

.badge-primary {
  background: var(--primary-color);
  color: #fff;
}

.badge-secondary {
  background: var(--secondary-color);
  color: #fff;
}

.badge-warning {
  background: var(--accent-color);
  color: #333;
}

.badge-male {
  background: #3498db;
  color: #fff;
}

.badge-female {
  background: #e91e63;
  color: #fff;
}

.badge-unknown {
  background: #999;
  color: #fff;
}

/* ============================================
   Grid
   ============================================ */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ============================================
   Section
   ============================================ */
.section {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .icon {
  font-size: 1.3rem;
}

.section-more {
  color: var(--primary-color);
  font-weight: 500;
}

/* ============================================
   Stats
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 5px;
}

/* ============================================
   Filter
   ============================================ */
.filter-bar {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
}

.filter-group {
  flex: 1;
  min-width: 150px;
}

.filter-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-light);
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--bg-white);
  transition: border-color 0.2s;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s;
  cursor: pointer;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
  color: var(--text-color);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

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

/* ============================================
   Pagination
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  font-weight: 500;
  transition: all 0.2s;
}

.pagination a:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.pagination .active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.pagination .disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ============================================
   Detail Page
   ============================================ */
.detail-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.detail-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-gallery {
  position: relative;
}

.detail-main-image {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  background: #f0f0f0;
}

.detail-thumbnails {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: var(--bg-color);
}

.detail-thumbnails img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.detail-thumbnails img:hover,
.detail-thumbnails img.active {
  opacity: 1;
}

.detail-body {
  padding: 30px;
}

.detail-title {
  font-size: 1.8rem;
  margin-bottom: 15px;
}

.detail-badges {
  margin-bottom: 20px;
}

.detail-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.detail-info-item {
  display: flex;
  gap: 10px;
}

.detail-info-label {
  font-weight: 500;
  color: var(--text-light);
  min-width: 80px;
}

.detail-info-value {
  color: var(--text-color);
}

.detail-description {
  padding: 20px;
  background: var(--bg-color);
  border-radius: var(--radius);
  margin-bottom: 25px;
}

.detail-description h3 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--text-light);
}

.detail-actions {
  display: flex;
  gap: 15px;
}

/* ============================================
   Map
   ============================================ */
.map-container {
  height: 500px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

#map {
  width: 100%;
  height: 100%;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-title {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--text-color);
}

.empty-desc {
  color: var(--text-light);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: #2c3e50;
  color: #fff;
  padding: 50px 0 30px;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.footer-top {
  margin-bottom: 40px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 15px;
}

.footer-desc {
  color: rgba(255,255,255,0.7);
  max-width: 400px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 15px;
  color: #fff;
}

.footer-col ul li {
  margin-bottom: 10px;
}

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

.footer-col ul li a:hover {
  color: #fff;
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

.copyright {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 5px;
}

.data-source {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}

/* ============================================
   AdSense
   ============================================ */
.ad-container {
  margin: 30px 0;
  text-align: center;
  min-height: 100px;
  background: var(--bg-color);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-container.ad-horizontal {
  min-height: 90px;
}

.ad-container.ad-square {
  min-height: 250px;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.hidden { display: none !important; }

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

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* ============================================
   Loading Spinner
   ============================================ */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
/* ============================================
   추가 스타일 - 기존 style.css 하단에 추가
   ============================================ */

/* ============================================
   상단 광고
   ============================================ */
.ad-top {
  margin-top: var(--header-height);
  padding: 15px 20px;
  background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border-color);
}

.ad-notice {
  font-size: 10px;
  color: #9ca3af;
  margin-top: 4px;
  text-align: center;
}

/* ============================================
   하단 광고
   ============================================ */
.ad-bottom {
  margin-top: 30px;
  padding: 20px;
  background: var(--bg-color);
  border-top: 1px solid var(--border-color);
}

/* ============================================
   사이드 광고 (양옆) - 데스크톱 전용
   ============================================ */
.ad-sidebar {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  max-height: 600px;
  z-index: 100;
  display: none;
}

.ad-left {
  left: 10px;
}

.ad-right {
  right: 10px;
}

@media (min-width: 1400px) {
  .ad-sidebar {
    display: block;
  }
}

/* ============================================
   모바일 사이드 네비게이션
   ============================================ */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 998;
}

.mobile-nav-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-sidebar {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  z-index: 999;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.mobile-nav-sidebar.open {
  right: 0;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-color);
}

.mobile-nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.mobile-nav-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: #666;
  cursor: pointer;
}

.mobile-nav-menu {
  flex: 1;
  padding: 10px 0;
  list-style: none;
}

.mobile-nav-item {
  border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: #333;
  text-decoration: none;
  font-size: 1rem;
}

.mobile-nav-link.active {
  color: var(--primary-color);
  font-weight: 600;
  background: #fff5f2;
}

.mobile-nav-icon {
  width: 28px;
  font-size: 1.2rem;
  margin-right: 10px;
}

.mobile-nav-arrow {
  margin-left: auto;
  font-size: 1.2rem;
  color: #999;
  transition: transform 0.3s;
}

.mobile-nav-item.has-submenu.open .mobile-nav-arrow {
  transform: rotate(90deg);
}

.mobile-nav-submenu {
  display: none;
  list-style: none;
  padding: 0;
  background: var(--bg-color);
}

.mobile-nav-item.has-submenu.open .mobile-nav-submenu {
  display: block;
}

.mobile-nav-submenu li a {
  display: block;
  padding: 12px 20px 12px 58px;
  color: #666;
  text-decoration: none;
  font-size: 0.95rem;
  border-top: 1px solid #e8e8e8;
}

.mobile-nav-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-color);
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.mobile-nav-footer a {
  color: #666;
  font-size: 0.85rem;
  text-decoration: none;
}

/* ============================================
   모바일 하단 고정 네비게이션
   ============================================ */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #fff;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  z-index: 997;
}

.mobile-bottom-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 5px;
  color: #666;
  text-decoration: none;
}

.mobile-bottom-item.active {
  color: var(--primary-color);
  font-weight: 600;
}

.mobile-bottom-icon {
  font-size: 1.4rem;
  margin-bottom: 2px;
}

.mobile-bottom-label {
  font-size: 0.7rem;
}
