/* ========================================
   Modern Header Styles
   ======================================== */

.site-header {
  background: var(--header-bg, #ffffff);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  position: relative;
  z-index: 999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sticky Header */
.site-header.sticky-header {
  position: sticky;
  top: 0;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: var(--header-glass, rgba(255, 255, 255, 0.85));
}

.site-header.is-scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  padding: 1.25rem 0;
  position: relative;
}

/* Site Branding */
.site-branding {
  flex-shrink: 0;
}

.site-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.site-title a {
  color: var(--heading-color, #111827);
  text-decoration: none;
  transition: color 0.3s ease;
}

.site-title a:hover {
  color: var(--primary-color, #2563eb);
}

.site-description {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  font-weight: 400;
}

.custom-logo-link {
  display: inline-block;
  line-height: 0;
}

.custom-logo {
  max-height: 60px;
  width: auto;
  transition: opacity 0.3s ease;
}

.custom-logo:hover {
  opacity: 0.8;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.header-search {
  position: relative;
}

.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--bg-tertiary, #f3f4f6);
  border-radius: 50%;
  color: var(--text-primary, #374151);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-toggle:hover {
  background: var(--primary-color, #2563eb);
  color: #ffffff;
  transform: scale(1.1);
}

.search-form-wrapper {
  position: absolute;
  top: calc(100% + 1.25rem);
  right: 0;
  width: 350px;
  background: var(--card-bg, #ffffff);
  border-radius: 24px;
  box-shadow: var(--shadow-lg, 0 10px 40px rgba(0, 0, 0, 0.15));
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  border: 1px solid var(--border-color, transparent);
}

.header-search.active .search-form-wrapper {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.search-form-wrapper .search-form {
  margin: 0;
}

.search-form-wrapper .search-field {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 2px solid var(--border-color, #e5e7eb);
  background: var(--input-bg, #ffffff);
  color: var(--text-primary);
  border-radius: 14px;
  font-size: 0.9375rem;
  transition: all 0.3s ease;
}

.search-form-wrapper .search-field:focus {
  outline: none;
  border-color: var(--primary-color, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-form-wrapper .search-submit {
  margin-top: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  background: var(--primary-color, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-form-wrapper .search-submit:hover {
  background: var(--primary-color-dark, #1d4ed8);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ========================================
   Modern Footer Styles
   ======================================== */

.site-footer {
  background: var(--footer-bg, #111827);
  color: #a1a1aa;
  margin-top: 6rem;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.05));
}

/* Footer Widgets */
.footer-widgets {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.05));
}

.footer-widgets-inner {
  display: grid;
  gap: 3rem;
}

.footer-columns-2 {
  grid-template-columns: repeat(2, 1fr);
}

.footer-columns-3 {
  grid-template-columns: repeat(3, 1fr);
}

.footer-columns-4 {
  grid-template-columns: repeat(4, 1fr);
}

.footer-widget-area {
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.footer-widget {
  margin-bottom: 2rem;
}

.footer-widget:last-child {
  margin-bottom: 0;
}

.footer-widget-title {
  color: var(--text-primary, #ffffff);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 2rem;
  padding-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.footer-widget-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 4px;
  background: var(--primary-color, #2563eb);
  border-radius: 10px;
}

.footer-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-widget ul li {
  margin-bottom: 0.75rem;
}

.footer-widget ul li:last-child {
  margin-bottom: 0;
}

.footer-widget a {
  color: #e5e7eb;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-widget a:hover {
  color: var(--primary-color, #60a5fa);
  transform: translateX(4px);
}

.footer-widget a::before {
  content: "→";
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.footer-widget a:hover::before {
  opacity: 1;
  transform: translateX(0);
}

/* Site Info */
.site-info {
  padding: 2rem 0;
}

.site-info-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
}

.copyright {
  color: #71717a;
  font-size: 0.9375rem;
}

/* Social Links */
.social-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-link:hover {
  background: var(--primary-color, #2563eb);
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.social-link svg {
  width: 20px;
  height: 20px;
}

/* Footer Navigation */
.footer-navigation {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-menu li {
  margin: 0;
}

.footer-menu a {
  color: #d1d5db;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.footer-menu a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color, #60a5fa);
  transition: width 0.3s ease;
}

.footer-menu a:hover {
  color: var(--primary-color, #60a5fa);
}

.footer-menu a:hover::after {
  width: 100%;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary-color, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
  z-index: 998;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-color-dark, #1d4ed8);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.4);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .header-inner {
    gap: 1rem;
  }

  .site-title {
    font-size: 1.5rem;
  }

  .footer-columns-3,
  .footer-columns-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .footer-widgets {
    padding: 3rem 0 2rem;
  }

  .footer-widgets-inner {
    gap: 2rem;
  }

  .footer-columns-2,
  .footer-columns-3,
  .footer-columns-4 {
    grid-template-columns: 1fr;
  }

  .site-info-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-menu {
    gap: 1rem;
  }

  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0.75rem 0;
  }

  .site-title {
    font-size: 1.25rem;
  }

  .custom-logo {
    max-height: 50px;
  }

  .search-form-wrapper {
    width: 280px;
  }

  .search-toggle {
    width: 36px;
    height: 36px;
  }

  .footer-menu {
    flex-direction: column;
    gap: 0.75rem;
  }
}