/* CABC 성경 검색 프로그램 - Main Styles */

body {
  font-family: "Malgun Gothic", sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: visible;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: visible;
}

.header-content {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.header-controls {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 8px;
}

.header-icon-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

/* Ensure tooltips are visible */
.header-icon-btn[title] {
  position: relative;
}

.header-icon-btn[title]::after {
  content: attr(title);
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease-in-out;
}

.header-icon-btn[title]:hover::after {
  opacity: 1;
}

/* Hide original slide controls since they're now in header */
.slide-controls {
  display: none;
}

.api-info {
  background: #e8f4fd;
  border: 1px solid #bee5eb;
  border-radius: 5px;
  padding: 15px;
  margin: 20px 30px;
  font-size: 14px;
  color: #0c5460;
}

.search-section {
  padding: 30px;
  border-bottom: 1px solid #eee;
}

.search-tabs {
  display: flex;
  margin-bottom: 30px;
  border-bottom: 1px solid #ddd;
}

.tab {
  padding: 15px 20px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
}

.tab.active {
  border-bottom-color: #667eea;
  color: #667eea;
  font-weight: bold;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.verse-search {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: bold;
  margin-bottom: 8px;
  color: #333;
}

.form-select,
.form-input {
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: white;
}

.form-select {
  padding: 10px;
  line-height: 1.6;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  width: 100%;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-select {
  background-image: url("data:image/svg+xml;charset=US-ASCII,...");
  /* 커스텀 화살표 SVG */
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.form-select:focus,
.form-input:focus {
  border-color: #667eea;
  outline: none;
}

.verse-range {
  display: flex;
  gap: 10px;
  align-items: center;
}

.verse-range input {
  width: 60px;
}

.keyword-search {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.keyword-input {
  flex: 1;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
}

.search-btn,
.slide-btn {
  padding: 15px 25px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s;
}
.slide-btn {
  min-width: 150px;
}
.search-btn:hover,
.slide-btn:hover {
  background: #5a67d8;
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}
.slide-controls {
  text-align: center;
  margin-top: 20px;
}
.tips {
  font-size: 14px;
  color: #666;
  margin-top: 10px;
}
.results-section {
  padding: 30px;
}

.verse-item {
  background: #f8f9ff;
  border: 1px solid #e1e5f2;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  position: relative;
}

.verse-item.selected {
  background-color: #dbeafe;
  border-color: #60a5fa;
}

.verse-text {
  line-height: 1.6;
  font-size: 16px;
  margin-bottom: 10px;
}

.debug-url {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  padding: 10px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: #495057;
  word-break: break-all;
  margin-bottom: 10px;
}

.verse-actions {
  text-align: right;
}

.display-btn {
  background: #48bb78;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

.display-btn:hover {
  background: #38a169;
}

.speak-btn {
  background: #ff6b6b;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  margin-left: 10px;
}

.speak-btn:hover {
  background: #e55353;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

.slide-preview {
  position: fixed;
  right: 20px;
  top: 20px;
  width: 300px;
  height: 200px;
  background: #333;
  color: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

.slide-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  line-height: 1;
}

.slide-preview h3 {
  margin: 0;
  font-size: 14px;
  opacity: 0.8;
}

.slide-preview-close {
  background: none;
  border: none;
  color: white;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.6;
  padding: 0;
  border-radius: 3px;
  transition: all 0.2s;
  line-height: 1;
  margin-left: 10px;
}

.slide-preview-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 4px;
}

.slide-content {
  font-size: 16px;
  line-height: 1.5;
}

/* Footer Styles */
.footer {
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  padding: 20px 0;
  margin-top: 40px;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.footer p {
  margin: 8px 0;
  color: #6c757d;
  font-size: 14px;
  line-height: 1.4;
}

.footer a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.footer a:hover {
  color: #5a67d8;
  text-decoration: underline;
}
@media (max-width: 640px) {
  .organization,
  .tips,
  .slide-controls,
  .form-group.option {
    display: none;
  }
  .form-input#dailyDate {
    width: 80px;
    padding: 12px 2px;
    -webkit-appearance: none;
    border-radius: 4px;
    border: 1px solid #ccc;
  }
  .search-btn#todayBibleBtn {
    padding: 15px 15px;
    width: 100%;
  }
  .desktop-only {
    display: none;
  }
  /* 모바일에서 "모두 선택" 체크박스를 새로운 줄에 표시 */
  .results-section
    div[style*="display: flex"][style*="justify-content: space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 15px;
  }
  /* 모바일에서 이전/다음 장 링크는 같은 줄에 유지 */
  .results-section
    div[style*="display: flex"][style*="justify-content: space-between"]
    a {
    flex-direction: row !important;
  }
  .results-section
    div[style*="text-align: center"]
    div[style*="display: flex"][style*="justify-content: space-between"] {
    flex-direction: row !important;
    justify-content: space-between !important;
  }
  /* 모바일에서 탭을 아이콘과 작은 글씨로 표시 */
  .search-tabs {
    justify-content: space-evenly !important;
  }
  .tab {
    flex-direction: column !important;
    align-items: center !important;
    padding: 8px 5px !important;
    font-size: 10px !important;
    flex: 1 !important;
    max-width: none !important;
  }
  .tab-icon {
    font-size: 18px !important;
    margin-bottom: 4px;
    display: block;
    width: 100%;
    text-align: center;
  }
  .tab-text {
    font-size: 10px !important;
    line-height: 1.2;
    text-align: center;
    word-break: keep-all;
  }
  /* 모바일에서 헤더 버튼 크기 조정 */
  .header-icon-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
  }
}
