/* John K. King Bookstore - Public Directory Styles */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  padding: 20px;
}

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

/* Header */
header {
  text-align: center;
  margin-bottom: 30px;
  border-bottom: 3px solid #4a5568;
  padding-bottom: 20px;
}

header h1 {
  color: #2d3748;
  font-size: 2rem;
  font-weight: 700;
}

/* Main Section */
main h2 {
  color: #4a5568;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

/* Search Controls */
.search-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

#search-bar {
  flex: 1;
  min-width: 200px;
  padding: 10px 15px;
  border: 2px solid #cbd5e0;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

#search-bar:focus {
  outline: none;
  border-color: #4a5568;
}

#floor-filter {
  padding: 10px 15px;
  border: 2px solid #cbd5e0;
  border-radius: 6px;
  font-size: 1rem;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.3s;
}

#floor-filter:focus {
  outline: none;
  border-color: #4a5568;
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

#search-button {
  background-color: #4a5568;
  color: white;
}

#search-button:hover {
  background-color: #2d3748;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#reset-button {
  background-color: #e2e8f0;
  color: #4a5568;
}

#reset-button:hover {
  background-color: #cbd5e0;
}

/* Status Messages */
#search-status,
#row-count {
  text-align: center;
  color: #4a5568;
  margin: 10px 0;
}

#row-count {
  font-size: 0.9rem;
  font-weight: 600;
}

/* Results Container */
#results-container {
  margin-top: 20px;
  overflow-x: auto;
}

/* Loading Message */
#loading-message {
  text-align: center;
  color: #718096;
  padding: 40px;
  font-size: 1.1rem;
}

/* Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th,
td {
  border: 1px solid #e2e8f0;
  padding: 12px;
  text-align: left;
}

th {
  background-color: #f7fafc;
  font-weight: 600;
  color: #2d3748;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

tr:nth-child(even) {
  background-color: #f8fafc;
}

tr:hover {
  background-color: #edf2f7;
  transition: background-color 0.2s;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 40px;
  color: #718096;
}

.no-results strong {
  color: #2d3748;
}

.suggestion-text {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #a0aec0;
}

/* Error Message */
.error {
  text-align: center;
  padding: 40px;
  color: #e53e3e;
  font-weight: 600;
}

/* Navigation */
.main-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.nav-btn {
  padding: 10px 20px;
  background-color: #e2e8f0;
  color: #4a5568;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.nav-btn:hover {
  background-color: #cbd5e0;
}

.nav-btn.active {
  background-color: #4a5568;
  color: white;
}

/* Section Visibility */
.section {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* FAQ Specific Styles */
#faq-search-bar {
  flex: 1;
  min-width: 200px;
  padding: 10px 15px;
  border: 2px solid #cbd5e0;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

#faq-search-bar:focus {
  outline: none;
  border-color: #4a5568;
}

#faq-search-button {
  background-color: #4a5568;
  color: white;
}

#faq-search-button:hover {
  background-color: #2d3748;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#faq-reset-button {
  background-color: #e2e8f0;
  color: #4a5568;
}

#faq-reset-button:hover {
  background-color: #cbd5e0;
}

#faq-search-status,
#faq-row-count {
  text-align: center;
  color: #4a5568;
  margin: 10px 0;
}

#faq-row-count {
  font-size: 0.9rem;
  font-weight: 600;
}

#faq-results-container {
  margin-top: 20px;
}

#faq-loading-message {
  text-align: center;
  color: #718096;
  padding: 40px;
  font-size: 1.1rem;
}

/* FAQ Cards */
.faq-cards-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.faq-card {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  transition: transform 0.2s, box-shadow 0.2s;
}

.faq-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.faq-question {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  user-select: none;
}

.faq-question:hover {
  color: #4a5568;
}

.faq-icon {
  margin-right: 8px;
}

.faq-toggle-icon {
  font-size: 1.25rem;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 10px;
}

.faq-toggle-icon.rotated {
  transform: rotate(180deg);
}

.faq-answer {
  color: #374151;
  font-size: 0.95rem;
  line-height: 1.6;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.faq-answer.expanded {
  max-height: 1000px;
  opacity: 1;
  margin-top: 10px;
}

.faq-answer p {
  margin-bottom: 10px;
}

.faq-category {
  margin-top: 15px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #f1f5f9;
  color: #4a5568;
  padding: 4px 12px;
  border-radius: 12px;
  display: inline-block;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 900px;
  height: 90vh;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px;
}

.modal-content h2 {
  color: #2d3748;
  font-size: 1.75rem;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2.5rem;
  color: #718096;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #2d3748;
}

.modal-iframe-container {
  flex: 1;
  width: 100%;
  height: 100%;
  margin: 0 -30px -30px -30px;
  overflow: hidden;
  border-radius: 0 0 12px 12px;
}

.feedback-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0 0 12px 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  header h1 {
    font-size: 1.5rem;
  }

  main h2 {
    font-size: 1.25rem;
  }

  .search-controls {
    flex-direction: column;
  }

  #search-bar,
  #floor-filter,
  button {
    width: 100%;
  }

  table {
    font-size: 0.85rem;
  }

  th,
  td {
    padding: 8px;
  }

  .main-nav {
    flex-direction: column;
    gap: 8px;
  }

  .nav-btn {
    width: 100%;
  }

  .faq-card {
    padding: 15px;
  }

  .faq-question {
    font-size: 1rem;
  }

  .modal-content {
    padding: 20px;
    width: 95%;
    height: 95vh;
  }

  .modal-content h2 {
    font-size: 1.5rem;
  }

  .modal-close {
    font-size: 2rem;
    top: 10px;
    right: 15px;
  }

  .modal-iframe-container {
    margin: 0 -20px -20px -20px;
  }
}
