/* MASYL - 최적화된 스타일시트 */

/* CSS 변수 (필수만) */
:root {
  --primary: #333;
  --surface: #ffffff;
  --background: #f9f9f9;
  --border: #ddd;
  --shadow: rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --space: 1rem;
  --transition: 0.2s ease;
}

/* 타이포그래피 */
h2 {
  font-size: 1.125rem;
  margin: 2rem 0 1rem 0;
  font-weight: 600;
}

h3 {
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0;
  padding: 0.75rem 0;
}

/* 테스트 설명 스타일 */
.test-description {
  font-size: 0.75rem;
  font-weight: 400;
  color: #666;
  line-height: 1.4;
  margin: 0;
  padding: 0 0.75rem 0.75rem 0.75rem;
  opacity: 0.9;
}

/* 카드 스타일 */
.test-card,
.highlight-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 6px var(--shadow);
  transition: var(--transition);
  text-align: center;
}

.test-card:hover,
.highlight-card:hover {
  box-shadow: 0 4px 12px var(--shadow);
  transform: translateY(-2px);
}

.highlight-card {
  margin-bottom: 1.5rem;
}

/* 슬라이더 컨테이너 */
.highlight-slider {
  position: relative;
  border-radius: var(--radius);
  background: transparent;
  transition: var(--transition);
}

.highlight-slider:hover {
  box-shadow: 0 4px 12px var(--shadow);
  transform: translateY(-2px);
}

/* 슬라이드 래퍼 */
.slides-wrapper {
  display: flex;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  width: 200%; /* 2개 슬라이드 */
  overflow: hidden;
  border-radius: var(--radius);
}

/* 개별 슬라이드 */
.slide {
  width: 50%; /* 전체 너비의 절반 */
  flex-shrink: 0;
  background: var(--surface);
  box-shadow: 0 2px 6px var(--shadow);
}

/* 슬라이드 인디케이터 */
.slide-indicators {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 0%;
  padding: 0.75rem 0;
  background: transparent;
}

.indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.indicator:hover {
  background-color: rgba(0, 0, 0, 0.4);
  transform: scale(1.1);
}

.indicator.active {
  background-color: var(--primary);
  transform: scale(1.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 터치 제스처 최적화 */
.highlight-slider {
  touch-action: pan-x;
  -webkit-user-select: none;
  user-select: none;
}

.highlight-card a,
.test-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* 하이라이트 카드 타이포그래피 */
.highlight-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  padding: 1rem 1rem 0.5rem 1rem;
  color: #1a1a1a;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.highlight-card .highlight-desc {
  font-size: 0.9rem;
  font-weight: 400;
  color: #555;
  line-height: 1.6;
  margin: 0;
  padding: 0 1rem 1.25rem 1rem;
  opacity: 0.85;
}

/* 썸네일 */
.thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  background-color: #e0e0e0;
}

.fallback-bg {
  background-color: #d0d0d0 !important;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21,15 16,10 5,21"/></svg>') !important;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 2rem;
  opacity: 0.5;
}

/* 그리드 */
.test-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* 카테고리 버튼 */
.category-btn {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  padding: 0.75rem 0.5rem;
  width: 100%;
  aspect-ratio: 1;
  font-size: 0.7rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  min-height: 70px;

  /* 터치 최적화 */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.category-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.category-btn:active {
  transform: scale(0.98);
}

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

.category-btn .icon {
  font-size: 1.5rem;
  display: block;
  line-height: 1;
}

.category-btn .label {
  font-weight: 500;
  line-height: 1.1;
}

/* 푸터 */
.site-footer {
  background-color: var(--surface);
  color: #666;
  font-size: 0.75rem;
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

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

.site-footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* About 페이지 스타일 */
.about-content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 2px 6px var(--shadow);
}

.about-section {
  margin-bottom: 2rem;
}

.about-section:last-child {
  margin-bottom: 0;
}

.about-section h2 {
  color: var(--primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.about-section h3 {
  color: var(--primary);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.about-section p {
  line-height: 1.7;
  margin: 0;
  color: #555;
}

.contact-email {
  margin-top: 1rem !important;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
}

.contact-email a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.contact-email a:hover {
  text-decoration: underline;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--space);
    width: 85%;
  }

  .main-header {
    padding: var(--space);
  }

  h1 {
    font-size: 1.25rem;
  }

  .test-list {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: var(--space);
  }

  /* 하이라이트 카드 모바일 최적화 */
  .highlight-card h3,
  .slide h3 {
    font-size: 1.1rem;
    padding: 0.875rem 0.875rem 0.5rem 0.875rem;
  }

  .highlight-card .highlight-desc,
  .slide .highlight-desc {
    font-size: 0.85rem;
    padding: 0 0.875rem 1rem 0.875rem;
    line-height: 1.5;
  }

  /* 슬라이드 인디케이터 모바일 최적화 */
  .slide-indicators {
    margin-top: 0rem;
    padding: 0.5rem 0;
    gap: 0.75rem;
  }

  .indicator {
    width: 12px;
    height: 12px;
  }

  /* 테스트 설명 모바일 최적화 */
  .test-description {
    font-size: 0.7rem;
    padding: 0 0.5rem 0.5rem 0.5rem;
    line-height: 1.3;
  }
}

@media (max-width: 480px) {
  .category-grid {
    gap: 0.5rem;
    padding: 0 0.25rem;
    max-width: 350px;
  }
  
  .category-btn {
    padding: 0.5rem 0.25rem;
    font-size: 0.65rem;
    min-height: 60px;
    gap: 0.2rem;
  }

  .category-btn .icon {
    font-size: 1.25rem;
  }
}
