/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background-color: #ffffff;
}

/* 헤더 스타일 */
header {
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #f0f0f0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
    font-size: 13px;
}

nav ul li a.active,
nav ul li a:hover {
    background-color: #f8f9fa;
    color: #3498db;
}

/* 메인 컨텐츠 */
main {
    margin-top: 80px;
    padding: 2rem 5%;
    background-color: #ffffff;
}

/* 히어로 섹션 */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    border-radius: 10px;
    max-width: 1400px;
    margin: 0 auto 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 검색 섹션 */
.search-section {
    margin-bottom: 3rem;
}

.search-container {
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
}

.search-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-box input {
    padding: 0.7rem;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 1rem;
    background-color: #ffffff;
}

.search-box input:focus {
    border-color: #74b9ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.1);
}

.filter-box {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: none;
}

.filter-box select {
    padding: 0.8rem;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    background-color: #ffffff;
    font-size: 0.95rem;
    width: 100%;
}

.filter-box select:focus {
    border-color: #74b9ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.1);
}

.search-btn {
    padding: 0.7rem 0;
    background-color: #74b9ff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    width: 100%;
    font-size: 1rem;
}

.search-btn:hover {
    background-color: #0984e3;
}

/* 과정 카드 그리드 */
.courses {
    max-width: 1400px;
    margin: 0 auto;
}

.courses h2 {
    margin-bottom: 2rem;
    color: #495057;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(370px, 1fr));
    gap: 2rem;
}

.course-card {
    position: relative; /* 기준점 역할 */
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    transition: transform 0.3s ease;
    border: 1px solid #f0f0f0;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.course-header {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.course-header .badge {
    background-color: #74b9ff;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.course-header .badge:nth-child(2) {
    background-color: #00b894;
}

.course-header .badge:nth-child(3) {
    background-color: #fd79a8;
}

.course-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.course-content {
    padding: 1.5rem;
}

.course-content h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    color: #495057;
    text-align: center;
    font-weight: 600;
}

.course-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.course-info span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #6c757d;
}

.course-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #f0f0f0;
}

/* 이미지 없는 카드용 */
.course-card.no-image {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 383px;
    background: #ffffff;
    border: 1px solid #f0f0f0;
}

.course-card.no-image .course-content p {
    margin: 1rem 0;
    color: #6c757d;
}

.stat {
    text-align: center;
}

.stat .label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.stat .value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #495057;
}

.course-dates {
    display: flex;
    justify-content: space-between;
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
}

.start-date, .end-date {
    font-weight: 500;
    color: #6c757d;
}

.btn {
    display: block;
    text-align: center;
    padding: 0.8rem;
    background-color: #74b9ff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #0984e3;
}

/* 푸터 */
footer {
    background-color: #495057;
    color: white;
    padding: 3rem 5% 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
}

.footer-section a:hover {
    opacity: 1;
}

.copyright {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.7;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        padding: 1rem;
    }

    nav ul {
        margin-top: 1rem;
    }

    nav ul li {
        margin: 0 0.5rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .search-container {
        padding: 1rem;
    }

    .search-box {
        gap: 1rem;
    }

    .search-input-container {
        gap: 0.5rem;
    }

    .search-box input {
        padding: 0.8rem;
        font-size: 1rem;
    }

    .search-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        width: 100%;
    }

    .filter-box {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .filter-box select {
        padding: 0.8rem;
    }

    .courses {
        padding: 1rem;
    }

    .course-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .course-card,
    .course-card.no-image {
        padding: 1rem;
    }

    .course-content {
        padding: 0;
    }

    .course-content h3 {
        font-size: 1.1rem;
    }

    .course-info {
        flex-direction: column;
        gap: 0.3rem;
    }

    .course-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .course-details {
        gap: 0.5rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
    }

    footer {
        padding: 1.5rem 1rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .page-btn {
        min-width: 2rem;
        height: 2rem;
        padding: 0 0.5rem;
        font-size: 0.9rem;
    }

    /* 브레드크럼 모바일 스타일 */
    .breadcrumb {
        padding: 0.5rem 1rem;
    }

    .breadcrumb ol {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .breadcrumb li {
        font-size: 0.8rem;
    }

    .breadcrumb li:not(:last-child)::after {
        margin: 0 0.25rem;
        font-size: 0.8rem;
    }

    .breadcrumb a {
        font-size: 0.8rem;
    }

    .breadcrumb li[aria-current="page"] {
        font-size: 0.8rem;
    }

    /* 검색 결과 헤더 모바일 스타일 */
    .search-results-header {
        padding: 1.5rem 1rem;
    }

    .search-results-header h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .search-results-header p {
        font-size: 1rem;
    }

    /* 검색 결과 없음 모바일 스타일 */
    .no-results {
        padding: 2rem 1rem;
        margin: 1rem;
    }

    .no-results h3 {
        font-size: 1.3rem;
    }

    .no-results p {
        font-size: 0.9rem;
    }

    .no-results li {
        font-size: 0.8rem;
    }
}

.course-details {
    margin: 1rem 0;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #f0f0f0;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.detail-item .label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.detail-item .value {
    font-weight: 600;
    color: #495057;
}

.course-capacity {
    margin: 1rem 0;
    padding: 0.75rem;
    background-color: #e3f2fd;
    border-radius: 5px;
    text-align: center;
    border: 1px solid #bbdefb;
}

.course-capacity .label {
    color: #1976d2;
    font-weight: 600;
    margin-right: 0.5rem;
}

.course-capacity .value {
    color: #495057;
    font-weight: 500;
}

/* 페이징 스타일 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.8rem;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    background-color: white;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background-color: #f8f9fa;
    border-color: #74b9ff;
    color: #74b9ff;
}

.page-btn.active {
    background-color: #74b9ff;
    border-color: #74b9ff;
    color: white;
}

/* 태블릿 크기 (768px ~ 1024px)에서의 최적화 */
@media (min-width: 769px) and (max-width: 1024px) {
    .search-container {
        padding: 1.5rem;
    }
    
    .search-box {
        gap: 1.5rem;
    }
    
    .search-input-container {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .search-box input {
        flex: 1;
        padding: 1rem;
        border: 2px solid #ddd;
    }
    
    .filter-box {
        grid-template-columns: repeat(3, 1fr);
        max-width: 700px;
    }
    
    .search-btn {
        padding: 1rem 2rem;
        max-width: 200px;
        width: auto;
    }
    
    .course-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
}

/* 큰 화면 (1025px 이상)에서의 최적화 */
@media (min-width: 1025px) {
    .search-container {
        padding: 2rem;
    }
    
    .search-box {
        gap: 1.5rem;
    }
    
    .search-input-container {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .search-box input {
        flex: 1;
        padding: 1rem;
        border: 2px solid #ddd;
    }
    
    .filter-box {
        grid-template-columns: repeat(4, 1fr);
        max-width: 900px;
    }
    
    .search-btn {
        padding: 1rem 2rem;
        max-width: 200px;
        width: auto;
    }
}

/* 브레드크럼 네비게이션 */
.breadcrumb {
  background-color: #f8f9fa;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.breadcrumb li {
  display: flex;
  align-items: center;
}

.breadcrumb li:not(:last-child)::after {
  content: "›";
  margin: 0 0.5rem;
  color: #6c757d;
  font-weight: bold;
}

.breadcrumb a {
  color: #74b9ff;
  text-decoration: none;
  font-size: 0.9rem;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb li[aria-current="page"] {
  color: #6c757d;
  font-size: 0.9rem;
}

/* 검색 결과 헤더 */
.search-results-header {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  padding: 2rem 1rem;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
}

.search-results-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #495057;
  margin-bottom: 0.5rem;
}

.search-results-header p {
  font-size: 1.1rem;
  color: #6c757d;
  margin: 0;
}

.search-results-header strong {
  color: #74b9ff;
  font-weight: 600;
}

/* 검색 결과 없음 상태 */
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin: 2rem auto;
  max-width: 600px;
  border: 1px solid #f0f0f0;
}

.no-results h3 {
  font-size: 1.5rem;
  color: #6c757d;
  margin-bottom: 1rem;
}

.no-results p {
  font-size: 1rem;
  color: #6c757d;
  margin-bottom: 1.5rem;
}

.no-results ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.no-results li {
  padding: 0.5rem 0;
  color: #6c757d;
  font-size: 0.9rem;
}

.no-results li::before {
  content: "💡";
  margin-right: 0.5rem;
}

/* 시각적으로 숨김 (스크린 리더용) */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* 검색 조건별 스타일링 */
.search-condition-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: linear-gradient(135deg, #74b9ff, #0984e3);
  color: white;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0 4px 8px 0;
  box-shadow: 0 2px 4px rgba(116, 185, 255, 0.3);
  transition: all 0.3s ease;
}

.search-condition-indicator:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(116, 185, 255, 0.4);
}

.search-condition-indicator .icon {
  width: 16px;
  height: 16px;
  opacity: 0.9;
}

.search-condition-clear {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.search-condition-clear:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* 검색 결과 카운터 */
.search-results-count {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-radius: 8px;
  border-left: 4px solid #74b9ff;
  border: 1px solid #f0f0f0;
}

.search-results-count .count-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: #74b9ff;
}

.search-results-count .count-text {
  color: #6c757d;
  font-size: 0.875rem;
}

/* 검색 조건 요약 */
.search-summary {
  background: #ffffff;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.search-summary-title {
  font-size: 1rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-summary-conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.search-summary-reset {
  background: #fd79a8;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-left: auto;
}

.search-summary-reset:hover {
  background: #e84393;
}

/* 로딩 상태 */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.course-card.loading {
  pointer-events: none;
}

.course-card.loading .course-title,
.course-card.loading .course-academy,
.course-card.loading .course-info {
  background: #f0f0f0;
  color: transparent;
  border-radius: 4px;
}

/* 성능 최적화 */
.course-card {
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.course-card img {
  will-change: transform;
  backface-visibility: hidden;
}

/* 접근성 개선 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 6px;
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
  .course-card {
    border: 2px solid #000;
  }
  
  .search-condition-indicator {
    background: #000;
    border: 1px solid #fff;
  }
  
  .btn-primary {
    background: #000;
    border: 2px solid #fff;
  }
}

/* 애니메이션 감소 모드 지원 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a;
    color: #e0e0e0;
  }
  
  header {
    background-color: #2d2d2d;
    border-bottom: 1px solid #404040;
  }
  
  .logo {
    color: #ffffff;
  }
  
  nav ul li a {
    color: #e0e0e0;
  }
  
  nav ul li a.active,
  nav ul li a:hover {
    background-color: #404040;
  }
  
  .search-container {
    background: #2d2d2d;
    border: 1px solid #404040;
  }
  
  .search-box input {
    background: #1a1a1a;
    border-color: #404040;
    color: #e0e0e0;
  }
  
  .filter-box select {
    background: #1a1a1a;
    border-color: #404040;
    color: #e0e0e0;
  }
  
  .search-summary {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
  }
  
  .search-results-count {
    background: linear-gradient(135deg, #2d2d2d, #404040);
    color: #e0e0e0;
  }
  
  .course-card {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
  }
  
  .course-card.no-image {
    background: #2d2d2d;
    border-color: #404040;
  }
  
  .course-content h3 {
    color: #ffffff;
  }
  
  .course-info span {
    color: #b0b0b0;
  }
  
  .course-stats {
    background-color: #1a1a1a;
    border-color: #404040;
  }
  
  .course-details {
    background-color: #1a1a1a;
    border-color: #404040;
  }
  
  .detail-item .label {
    color: #b0b0b0;
  }
  
  .detail-item .value {
    color: #ffffff;
  }
  
  .course-capacity {
    background-color: #1e3a5f;
    border-color: #2563eb;
  }
  
  .course-capacity .label {
    color: #60a5fa;
  }
  
  .course-capacity .value {
    color: #ffffff;
  }
  
  .course-dates {
    background-color: #1a1a1a;
    border-color: #404040;
    color: #b0b0b0;
  }
  
  .start-date, .end-date {
    color: #e0e0e0;
  }
  
  .btn {
    background-color: #2563eb;
    color: #ffffff;
  }
  
  .btn:hover {
    background-color: #1d4ed8;
  }
  
  footer {
    background-color: #1a1a1a;
    border-top: 1px solid #404040;
  }
  
  .breadcrumb {
    background-color: #2d2d2d;
    border-color: #404040;
  }
  
  .breadcrumb a {
    color: #60a5fa;
  }
  
  .breadcrumb li[aria-current="page"] {
    color: #b0b0b0;
  }
  
  .search-results-header {
    background: linear-gradient(135deg, #2d2d2d, #404040);
  }
  
  .search-results-header h1 {
    color: #ffffff;
  }
  
  .search-results-header p {
    color: #b0b0b0;
  }
  
  .no-results {
    background-color: #2d2d2d;
    border: 1px solid #404040;
  }
  
  .no-results h3 {
    color: #ffffff;
  }
  
  .no-results p {
    color: #b0b0b0;
  }
  
  .no-results li {
    color: #b0b0b0;
  }
  
  .page-btn {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
  }
  
  .page-btn:hover {
    background-color: #404040;
    border-color: #60a5fa;
    color: #60a5fa;
  }
  
  .page-btn.active {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
  }
} 