/* 공통 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Noto Sans KR", sans-serif;
  background-color: #f5f5f5;
  scroll-behavior: smooth;
}

/* 공통 스타일 */
body {
  font-family: "Noto Sans KR", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #070e2a; /* 기본 다크 모드 배경색 */
  color: #ffffff; /* 기본 다크 모드 텍스트 색상 */
  transition: background-color 0.3s ease, color 0.3s ease; /* 부드러운 전환 효과 */
}


/* 라이트 모드 스타일 */
body.light-mode {
  background-color: #f9fbff; /* 라이트 모드 배경색 */
  color: #333333; /* 라이트 모드 텍스트 색상 */
}


/* 헤더 스타일 */
.header {
  background-color: #1e1e1e; /* 기본 다크 모드 헤더 배경색 */
  padding: 20px 0;
  box-shadow: none;
  transition: background-color 0.3s ease; /* 부드러운 전환 효과 */
}

body.light-mode .header {
  background-color: #ffffff; /* 라이트 모드 헤더 배경색 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 헤더 그림자 */
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  width: 170px;
  /* height: 40px; */
  margin-right: 10px;
}

.logo h1 {
  font-size: 1.5rem;
  color: #ffffff; /* 기본 다크 모드 텍스트 색상 */
  margin: 0;
  transition: color 0.3s ease; /* 부드러운 전환 효과 */
}

body.light-mode .logo h1 {
  color: #333333; /* 라이트 모드 텍스트 색상 */
}

.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
}

.theme-toggle-btn img {
  width: 24px;
  height: 24px;
  /* filter: invert(100%); 아이콘 색상을 흰색으로 변경 */
  transition: transform 0.3s ease;
}

.theme-toggle-btn:hover img {
  transform: rotate(90deg); /* 호버 시 회전 효과 */
}

/* 필터 버튼 스타일 */
.filters {
  max-width: 1200px;
  margin: 10px auto 0;
  display: flex;
  justify-content: right;
  gap: 10px;
  padding-right: 10px;
}

/* 필터 버튼 스타일 */
.filter-btn {
  padding: 10px 20px;
  border: none;
  background-color: #333333; /* 기본 다크 모드 버튼 배경색 */
  color: #ffffff; /* 기본 다크 모드 버튼 텍스트 색상 */
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease; /* 부드러운 전환 효과 */
}

body.light-mode .filter-btn {
  background-color: #e5e7eb; /* 라이트 모드 버튼 배경색 */
  color: #333333; /* 라이트 모드 버튼 텍스트 색상 */
}

.filter-btn.active {
  background-color: #f15c56; /* 활성화된 버튼 배경색 */
  color: #ffffff; /* 활성화된 버튼 텍스트 색상 */
}

.filter-btn:hover {
  background-color: #444444; /* 다크 모드 호버 배경색 */
}

body.light-mode .filter-btn:hover {
  background-color: #d1d5db; /* 라이트 모드 호버 배경색 */
  color: #000000; /* 라이트 모드 호버 텍스트 색상 */
}

/* 확장 프로그램 카드 스타일 */
.extensions {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(300px, 1fr)
  ); /* 최소 300px, 최대 3개 열 */
  gap: 20px; /* 카드 간격 */
  padding: 20px;
  max-width: 1200px; /* 최대 너비 설정 */
  margin: 0 auto; /* 중앙 정렬 */
}

.extension-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #2c2f33; /* 기본 다크 모드 카드 배경색 */
  border-radius: 10px;
  padding: 20px;
  margin: 10px 0;
  box-shadow: none;
  color: #ffffff; /* 기본 다크 모드 텍스트 색상 */
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s ease, transform 0.3s ease; /* 부드러운 전환 효과 */
}

.extension-card.hidden {
  opacity: 0; /* 숨길 때 투명하게 */
  transform: scale(0.95); /* 약간 축소 */
  pointer-events: none; /* 숨겨진 카드 클릭 방지 */
  display: none;
}

.extension-card.visible {
  opacity: 1; /* 나타날 때 완전 불투명 */
  transform: scale(1); /* 원래 크기로 복원 */
  pointer-events: auto; /* 클릭 가능 */
  display: flex; /* 플렉스 박스 사용 */
}

/* 카드 컨테이너 */
.extensions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 최소 300px, 최대 1열 */
  gap: 20px; /* 카드 간 간격 */
  padding: 20px;
  max-width: 1200px; /* 최대 폭 설정 */
  margin: 0 auto; /* 가운데 정렬 */
}

body.light-mode .extension-card {
  background-color: #ffffff; /* 라이트 모드 카드 배경색 */
  color: #333333; /* 라이트 모드 텍스트 색상 */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 카드 그림자 */
}

/* 아이콘과 제목/설명을 가로로 정렬 */
.extension-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.extension-icon {
  width: 50px;
  height: 50px;
  margin-right: 15px; /* 아이콘과 텍스트 간 간격 */
}

.extension-details {
  flex: 1;
  text-align: left;
}

.extension-details h2 {
  font-size: 1.2rem;
  margin: 0 0 5px;
}

.extension-details p {
  font-size: 0.9rem;
  color: #b0b0b0;
}

.toggle-btn {
  padding: 10px 20px;
  background-color: #4a90e2;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.toggle-btn:hover {
  background-color: #357abd;
}

/* Remove 버튼과 Toggle 스위치를 아랫줄에 배치 */
.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto; /* 항상 아래로 배치 */
  padding-top: 15px;
  /* border-top: 1px solid #444; 상단에 구분선 추가 */
}

/* Remove 버튼 스타일 */
.remove-btn {
  background-color: #1f2535; /* 기본 다크 모드 버튼 배경색 */
  color: #ffffff; /* 기본 다크 모드 버튼 텍스트 색상 */
  border: 1px solid #555b6b; /* 기본 다크 모드 버튼 테두리 */
  padding: 8px 15px;
  border-radius: 15px;
  cursor: pointer;
  font-size: 0.9rem;
}

body.light-mode .remove-btn {
  background-color: #e5e7eb; /* 라이트 모드 버튼 배경색 */
  color: #333333; /* 라이트 모드 버튼 텍스트 색상 */
  border: 1px solid #d1d5db; /* 라이트 모드 버튼 테두리 */
}

.remove-btn:hover {
  background-color: #ff1a1a; /* 다크 모드 호버 배경색 */
  color: #ffffff; /* 다크 모드 호버 텍스트 색상 */
}

body.light-mode .remove-btn:hover {
  background-color: #d1d5db; /* 라이트 모드 호버 배경색 */
  color: #000000; /* 라이트 모드 호버 텍스트 색상 */
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc; /* 기본 다크 모드 토글 배경색 */
  border-radius: 20px;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #f15c56; /* 활성화된 토글 배경색 */
}

input:checked + .slider:before {
  transform: translateX(14px);
}

body.light-mode .slider {
  background-color: #e5e7eb; /* 라이트 모드 토글 배경색 */
}

body.light-mode input:checked + .slider {
  background-color: #f15c56; /* 라이트 모드 활성화된 토글 배경색 */
}

/* 반응형 스타일 */
@media (min-width: 768px) {
  .extensions {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    /* 작은 화면에서는 최소 250px */
    padding: 10px;
    /* 여백 줄이기 */
  }

  .extension-card {
    flex-direction: column; /* 항상 세로 정렬 유지 */
  }

  .extension-icon {
    margin-bottom: 15px;
  }

  .extension-details {
    flex: 1;
  }

  .card-actions {
    margin-top: auto; /* 항상 아래로 배치 */
  }
}

@media (min-width: 1024px) {
  .extensions {
    grid-template-columns: repeat(3, 1fr);
    /* 큰 화면에서는 최대 3개 열 */
  }
}

/* 푸터 스타일 */
.footer {
  text-align: center;
  padding: 10px;
  background-color: #1e1e1e; /* 기본 다크 모드 배경색 */
  font-size: 12px;
  color: #aaaaaa; /* 기본 다크 모드 텍스트 색상 */
  transition: background-color 0.3s ease, color 0.3s ease; /* 부드러운 전환 효과 */
}

.footer a {
  color: #4a90e2; /* 기본 다크 모드 링크 색상 */
  text-decoration: none;
}

body.light-mode .footer {
  background-color: #ffffff; /* 라이트 모드 배경색 */
  color: #333333; /* 라이트 모드 텍스트 색상 */
}

body.light-mode .footer a {
  color: #f15c56; /* 라이트 모드 링크 색상 */
}