/* Base Styles */
body {
  font-family: 'CircularStd', sans-serif;
  background-color: #f8f9fa;
  color: #333;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- 1. Site Header (Navbar) --- */
.site-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 0 2rem;
  box-sizing: border-box;
  width: 100%;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  height: 70px;
  position: relative;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1f2937;
  text-decoration: none;
  z-index: 110;
}

.nav-links {
  display: flex;
  align-items: center;
}

.nav-links a {
  color: #4b5563;
  text-decoration: none;
  font-weight: 500;
  margin-left: 2rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #4f46e5;
}

/* --- 2. Hero Section --- */
.hero-section {
  background: linear-gradient(90deg, #4f46e5 0%, #3b82f6 100%);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
}

.hero-section .hero-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 1rem;
}

.hero-section .hero-subtitle {
  font-size: 1.25rem;
  color: #e0e7ff;
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

/* --- 3. The Checker Card --- */
.checker-container {
  width: 100%;
  max-width: 550px;
  box-sizing: border-box;
  margin: 0 auto;
  text-align: left;
}

#username-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.form-row #username-input {
  flex-grow: 1;
  width: 100%;
}

.form-row .btn-primary {
  flex-shrink: 0;
}

#username-input {
  width: 100%;
  padding: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'CircularStd', sans-serif;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#username-input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.btn-primary {
  background-color: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 1rem;
  font-weight: bold;
  font-size: 1rem;
  font-family: 'CircularStd', sans-serif;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

.btn-primary:hover {
  background-color: #4338ca;
}

.btn-primary:disabled {
  background-color: #9ca3af;
  color: #e5e7eb;
  cursor: not-allowed;
}

/* --- Result Box --- */
#result {
  display: none;
  margin-top: 1.5rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  background-color: #f8f9fa;
  padding: 1.25rem;
  border-radius: 8px;
  min-height: 1.5em;
  border: 1px solid #e5e7eb;
  border-top: none;
}

#result p {
  margin: 0;
}

/* --- 4. Info Section --- */
.info-section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  flex-grow: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  text-align: left;
}

@media (min-width: 768px) {
  .info-section {
    grid-template-columns: 1fr 1fr;
  }
}

.info-section h2 {
  font-size: 1.75rem;
  font-weight: bold;
  color: #1f2937;
  margin-top: 0;
  margin-bottom: 1rem;
}

.info-section p {
  color: #4b5563;
  line-height: 1.6;
  font-size: 1.05rem;
}

/* --- 5. Site Footer --- */
.site-footer {
  background-color: #1f2937;
  color: #e5e7eb;
  padding: 3rem 2rem;
  text-align: center;
  margin-top: auto;
}

.site-footer p {
  margin: 0;
  color: #9ca3af;
}

/* --- 6. Recent Searches --- */
.recent-searches-list {
  list-style: none;
  padding-left: 0;
  margin-top: 1rem;
}

.recent-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 1.05rem;
}

.recent-search-item:last-child {
  border-bottom: none;
}

.search-time {
  font-size: 0.9rem;
  color: #6b7280;
  font-style: italic;
  margin-left: 1rem;
  flex-shrink: 0;
}

.icon-check {
  color: #28a745;
  font-weight: bold;
  margin-right: 0.5rem;
}

.icon-cross {
  color: #dc3545;
  font-weight: bold;
  margin-right: 0.5rem;
}

.recent-search-item > span:first-child {
  display: flex;
  align-items: center;
  font-weight: 500;
}

/* --- 7. Real-time Validation Rules --- */
.validation-rules {
  display: block;
  margin: 0;
  font-size: 0.9rem;
  background-color: #ffffff;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e7eb;
}

.rule {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.25rem;
  transition: all 0.2s;
  color: #333;
}

.rule .icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  margin-right: 0.6rem;
  font-weight: bold;
  border-radius: 50%;
  font-size: 1rem;
  color: #6b7280;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.rule .icon::before {
  content: '\2014';
  position: relative;
  top: -1px;
}

.rule.invalid {
  color: #b91c1c;
}

.rule.invalid .icon {
  color: white;
  background-color: #dc3545;
  border: 1px solid #dc3545;
}

.rule.invalid .icon::before {
  content: '\00d7';
  top: 0;
}

.rule.valid {
  color: #166534;
}

.rule.valid .icon {
  color: white;
  background-color: #28a745;
  border: 1px solid #28a745;
}

.rule.valid .icon::before {
  content: '\2713';
  top: 0;
}

/* --- 8. Button Spinner --- */
.btn-spinner {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- 9. Mobile Navigation --- */
.burger-button {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 36px;
  height: 36px;
  padding: 6px;
  background-color: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  z-index: 110;
}

.burger-line {
  width: 100%;
  height: 3px;
  background-color: #4b5563;
  border-radius: 3px;
  transition: all 0.3s ease-in-out;
}

.burger-button.is-open .burger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.burger-button.is-open .burger-line:nth-child(2) {
  opacity: 0;
}

.burger-button.is-open .burger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 768px) {
  .burger-button {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    align-items: stretch;
    z-index: 100;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    margin: 0;
    padding: 1.25rem 2rem;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
  }

  .nav-links a:last-child {
    border-bottom: none;
  }
}
