:root {
  --primary-color: #4C6EF5;
  --primary-hover: #3B5CDD;
  --text-color: #333;
  --font-family: 'Inter', sans-serif;
  --transition-speed: 0.3s;
  --focus-outline: 2px solid #000;
  --background-color: #f6f7fb;
  --card-background: #ffffff;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #fff;
  color: #000;
  padding: 8px;
  z-index: 100;
}
.skip-link:focus {
  top: 0;
}

header {
  background: var(--primary-color);
  color: #fff;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
header h1 {
  margin: 0;
  font-weight: 600;
  font-size: 1.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

#loadingBar {
  position: relative;
  width: 100%;
  height: 3px;
  background: #e0e0e0;
  overflow: hidden;
  transition: opacity 0.3s;
  opacity: 0;
}
#loadingBar.loading {
  opacity: 1;
}
#loadingBar.loading::before {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: var(--primary-color);
  animation: loadingBarAnim 1.2s linear infinite;
}
@keyframes loadingBarAnim {
  from { left: -50%; }
  to { left: 100%; }
}

main {
  padding: 1rem;
}

.search-container {
  max-width: 600px;
  margin: 2rem auto 0;
  text-align: center;
}
.intro-text {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #555;
}

.search-bar {
  position: relative;
  display: inline-block;
  width: 100%;
}
.search-bar input[type="text"] {
  padding: 1rem;
  border: 1px solid #ccc;
  width: 100%;
  max-width: 600px;
  border-radius: 8px;
  outline: none;
  transition: border-color var(--transition-speed);
  font-size: 1.1rem;
  background: #fff;
  box-sizing: border-box;
  text-align: left;
}
.search-bar input[type="text"]:focus {
  border-color: var(--primary-hover);
}

/* When input has content (not placeholder), reduce font-size on mobile */
@media (max-width: 600px) {
  .search-bar input[type="text"]:not(:placeholder-shown) {
    font-size: 1rem; /* Slightly smaller on mobile after selection */
  }
}

.clear-btn {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem; /* Increased size */
  color: #666;       /* Darker color for visibility */
  cursor: pointer;
  user-select: none;
  transition: color 0.3s;
}
.clear-btn:hover {
  color: #000; /* Even darker on hover */
}

.suggestions-container {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  z-index: 999;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  box-sizing: border-box;
}
.suggestion-item {
  padding: 0.75rem;
  cursor: pointer;
  font-size: 1rem;
  text-align: left;
  white-space: normal;
}
.suggestion-item:hover,
.suggestion-item.highlight {
  background: #f0f0f0;
}

.error {
  color: red;
  margin: 1rem;
  text-align: center;
  font-weight: 500;
}

.tabs-instruction {
  text-align: left;
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto; /* Allow horizontal scrolling if needed */
  background: #f7f7f7;
  border-radius: 8px;
  padding: 0.5rem;
  scroll-snap-type: x mandatory;
}

.tabs [role="tab"] {
  flex: 0 0 auto;
  scroll-snap-align: start;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: #fff;
  color: #555;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.3s;
}

.tabs [role="tab"]:hover {
  background: #e7e7e7;
}

.tabs [role="tab"][aria-selected="true"] {
  background: var(--primary-color);
  color: #fff;
  font-weight: 600;
  border-bottom: none;
  border-radius: 6px;
}


.tab-content[role="tabpanel"] {
  display: none;
  background: var(--card-background);
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.tab-content[aria-hidden="false"] {
  display: block;
}

section.details-section {
  background: var(--card-background);
  margin-bottom: 1rem;
}
section.details-section details {
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  overflow: hidden;
  background: #fff;
}
section.details-section details:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
section.details-section summary {
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  outline: none;
  font-size: 1.1rem;
  padding: 0.5rem 0;
  list-style: none;
  position: relative;
  color: #333;
}
section.details-section summary:focus {
  outline: var(--focus-outline);
}
section.details-section summary::after {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  background: transparent;
  mask: url("data:image/svg+xml,%3Csvg fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 18l6-6-6-6'%3E%3C/path%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  transition: transform var(--transition-speed);
  transform: rotate(0deg);
  background-color: var(--primary-color);
}
section.details-section[open] summary::after {
  transform: rotate(90deg);
}

.details-section .data-item {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}
.data-item strong {
  display: inline-block;
  width: 160px;
  font-weight: 500;
  color: #333;
}

footer.footer-section {
  background: #f9f9f9;
  color: #333;
  padding: 2rem 1rem;
  border-top: 1px solid #ddd;
  margin-top: 2rem;
  text-align: left;
  font-size: 0.85rem;
  line-height: 1.4;
}
.container.footer-container {
  max-width: 800px;
  margin: 0 auto;
}
.footer-heading {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-align: center; /* Center the headings */
}

.footer-text {
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: justify; /* Justify the text in paragraphs */
}

.footer-list {
  list-style: disc;
  margin-left: 1.5rem;
  font-size: 0.85rem;
  margin-top: 1rem;
  text-align: justify; /* Justify the list items as well */
  text-justify: inter-word; /* Helps achieve better justification if supported */
}

.footer-credits-text {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.floating-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary-color);
  color: #fff;
  font-size: 1rem; /* Decrease font size */
  padding: 0.5rem 1rem; /* Decrease padding */
  border-radius: 30px;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: background var(--transition-speed);
}

.floating-btn:hover {
  background: var(--primary-hover);
}

.footer-link {
  color: var(--primary-color);
  text-decoration: none;
}
.footer-link:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .search-bar input[type="text"] {
    width: 100%;
    max-width: 100%;
    padding-right: 2.5rem; /* ensure room for clear icon */
  }
  .suggestions-container {
    width: 100%;
    max-width: 100%;
  }
  .data-item strong {
    width: 120px;
  }
}

.rotating-house {
  animation: rotateHouse 1.2s linear infinite;
  font-size: 2rem;
  color: #4C6EF5;
}

@keyframes rotateHouse {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Skeleton styles */
#skeletonContainer {
  padding: 1rem;
}

.skeleton-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.skeleton-tab {
  background: #ddd;
  border-radius: 4px;
  width: 80px;
  height: 20px;
}

.skeleton-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skeleton-line {
  background: #ddd;
  height: 14px;
  border-radius: 4px;
  width: 100%;
}

.skeleton-line.short {
  width: 50%;
}

/* Add a subtle animation to skeleton */
.skeleton-tab, .skeleton-line {
  animation: skeleton-loading 1.5s infinite linear;
}

@keyframes skeleton-loading {
  0% { background-color: #ddd; }
  50% { background-color: #ccc; }
  100% { background-color: #ddd; }
}

.header-subtext {
  font-size: 0.9rem;       /* Smaller than the main heading */
  font-weight: 400;        /* Normal weight */
  margin-top: 0.5rem;      /* Spacing above the subtext */
  color: #f0f0f0;          /* A lighter shade of white for subtle contrast */
  text-align: center;      /* Centered under the main heading */
}
