/* School Index - Professional Directory Styles */

:root {
  --primary: #1b4332;
  --accent: #f0b429;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --nav-height: 80px;
}

body {
  background-color: var(--surface);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  letter-spacing: -0.01em;
}

/* Touch-optimized button feedback */
button:active,
a:active {
  transform: scale(0.96);
  transition: transform 0.1s ease;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav.scroll-down {
  transform: translateY(-100%);
}

nav.scroll-up {
  transform: translateY(0);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Structured Card Design */
.school-card-pro {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease-in-out;
}

.school-card-pro:hover {
  border-color: var(--primary);
  box-shadow: 0 10px 25px -5px rgba(27, 67, 50, 0.08);
  transform: translateY(-2px);
}

/* ENTERPRISE RESPONSIVE GRID & LIST */
@media (max-width: 640px) {
  #schoolResults.grid-view {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    padding: 0.5rem !important;
  }

  /* Mobile Grid Card */
  .school-card-pro {
    border-radius: 1rem !important;
    border: 1px solid #f1f5f9 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
  }
  /* Ensure the location text doesn't overflow */
  .school-card-pro .truncate {
    max-width: 100%;
  }
  /* Compact badge sizes on mobile */
  .school-card-pro .badge-verified-gold,
  .school-card-pro .badge-verified-silver {
    font-size: 6px !important;
    padding: 2px 5px !important;
    border-radius: 4px !important;
    gap: 2px !important;
  }
  .school-card-pro .badge-verified-gold i,
  .school-card-pro .badge-verified-silver i {
    width: 0.55rem !important;
    height: 0.55rem !important;
  }
  .school-card-pro .claim-btn-small {
    font-size: 6px !important;
    padding: 2px 5px !important;
  }

  /* ENTERPRISE LIST ITEM */
  .school-list-item {
    flex-direction: row !important;
    padding: 0.4rem !important;
    gap: 0.5rem !important;
    align-items: stretch !important;
    border-radius: 0.75rem !important;
  }
  .school-list-item .w-20.h-20 {
    width: 60px !important;
    height: 60px !important;
    border-radius: 0.5rem !important;
  }
  .school-list-item h4 {
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    margin-bottom: 2px !important;
  }
  .school-list-item .flex.flex-wrap.items-center.gap-x-3 {
    gap-x: 0.35rem !important;
    margin-bottom: 2px !important;
  }
  .school-list-item .text-\[10px\] {
    font-size: 6px !important;
    letter-spacing: 0 !important;
  }
  .school-list-item .md\:min-w-\[180px\] {
    width: 40px !important;
    min-width: 0 !important;
    flex-direction: column !important;
    gap: 0.15rem !important;
    justify-content: center !important;
  }
  .school-list-item .md\:min-w-\[180px\] a {
    padding: 0.25rem 0 !important;
    font-size: 6px !important;
    border-radius: 4px !important;
    text-align: center !important;
  }
  .school-list-item .md\:min-w-\[180px\] .flex.gap-2 {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.15rem !important;
  }
  .school-list-item .md\:min-w-\[180px\] .flex.gap-2 button {
    width: 1.25rem !important;
    height: 1.25rem !important;
    padding: 0 !important;
  }
  .school-list-item .md\:min-w-\[180px\] .flex.gap-2 i {
    width: 0.65rem !important;
    height: 0.65rem !important;
  }
}

/* SMART SIDE DRAWER - Enterprise Slide-over */
@media (max-width: 1024px) {
  #sidebarFilters {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 300px;
    height: 100vh;
    background: white;
    z-index: 2000;
    padding: 1.25rem !important;
    box-shadow: -15px 0 45px rgba(0, 0, 0, 0.1);
    transition: right 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: block !important;
  }
  #sidebarFilters.active {
    right: 0;
  }
  #sidebarFilters .space-y-8 {
    /* Filter contents */
  }
  #sidebarFilters .bg-white.border {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    position: relative !important;
    top: 0 !important;
  }
}

/* Premium Verification Badges */
.badge-verified-gold {
  background: linear-gradient(135deg, #ffd700 0%, #f0b429 100%);
  color: #1b4332;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(240, 180, 41, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.4);
  animation: goldPulse 2s infinite;
}

.badge-verified-silver {
  background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
  color: #1e293b;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(148, 163, 184, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

@keyframes goldPulse {
  0% {
    box-shadow: 0 4px 15px rgba(240, 180, 41, 0.3);
  }
  50% {
    box-shadow: 0 4px 25px rgba(240, 180, 41, 0.5);
  }
  100% {
    box-shadow: 0 4px 15px rgba(240, 180, 41, 0.3);
  }
}

/* Removed goldPulse animation */

.claim-btn-small {
  background: white;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
}
.claim-btn-small:hover {
  background: #f8fafc;
  color: var(--primary);
  border-color: var(--primary);
}

/* Search Glow */
.search-input-group:focus-within {
  box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.2);
  border-color: var(--accent);
}

/* Labeled Compare Button */
.compare-btn-labeled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: #475569;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.compare-btn-labeled:hover {
  transform: scale(1.05);
  background: white;
  border-color: var(--accent);
}

.compare-btn-labeled.active {
  background: var(--accent);
  color: var(--primary);
  border-color: var(--accent);
}

/* List View Item */
.school-list-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.school-list-item:hover {
  border-color: var(--primary);
  background-color: #f8fafc;
}

/* Animations */
/* Social Interaction States */
.fill-accent {
  fill: var(--accent) !important;
}
.fill-red-500 {
  fill: #ef4444 !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 28, 21, 0.4);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow-y: auto;
  padding: 1rem;
}
.modal-overlay.active {
  display: flex;
}
.modal-content {
  background: white;
  width: 100%;
  max-width: 450px;
  padding: 2.5rem;
  border-radius: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modalSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin: auto;
}
@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mobile Navigation Drawer */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 28, 21, 0.4);
  backdrop-filter: blur(8px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100%;
  background: white;
  z-index: 1001;
  padding: 2.5rem 2rem;
  box-shadow: -15px 0 40px rgba(8, 28, 21, 0.15);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-nav-overlay.active .mobile-nav-drawer {
  transform: translateX(-320px);
}

/* Responsive Utilities */
@media (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }
  .show-on-mobile {
    display: block !important;
  }

  /* Filter Bottom Sheet (Concept) */
  .filter-sidebar-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-top-left-radius: 2.5rem;
    border-top-right-radius: 2.5rem;
    z-index: 1000;
    padding: 2.5rem 2rem;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.15);
  }
  .filter-sidebar-mobile.active {
    transform: translateY(0);
  }

  .filter-sidebar-mobile::before {
    content: '';
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 10px;
  }
}

.show-on-mobile {
  display: none;
}

/* Table Responsiveness */
.responsive-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ENTERPRISE BOTTOM NAVIGATION */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid #f1f5f9;
  display: none;
  grid-template-columns: repeat(6, 1fr);
  z-index: 400;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: grid;
  }
  body {
    padding-bottom: 80px;
  } /* Prevent overlap */
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #94a3b8;
  transition: all 0.2s ease;
}
.bottom-nav-item.active {
  color: var(--primary);
}
.bottom-nav-item i {
  width: 20px;
  height: 20px;
}
.bottom-nav-item span {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* REFINED SMART HEADER */
nav.scroll-down {
  transform: translateY(-100%);
}
nav.scroll-up {
  transform: translateY(0);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

/* Hide scrollbar but keep functionality */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Custom Select Arrow for appearance-none */
.custom-select-wrapper {
  position: relative;
}
.custom-select-wrapper::after {
  content: '\e931'; /* lucide-chevron-down */
  font-family: 'lucide' !important;
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 1rem;
  color: var(--primary);
  opacity: 0.5;
}

/* RESPONSIVE GRID OPTIMIZATION FOR LARGER SCREENS */
@media (min-width: 768px) {
  /* Tablet and up - 3 columns */
  #schoolGrid.grid-view {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 0;
  }
}

@media (min-width: 1024px) {
  /* Laptop - 4 columns */
  #schoolGrid.grid-view {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }

  .school-card-pro {
    border-radius: 14px;
  }
}

@media (min-width: 1280px) {
  /* Large Desktop - 5 columns */
  #schoolGrid.grid-view {
    grid-template-columns: repeat(5, 1fr);
    gap: 1.75rem;
  }
}

@media (min-width: 1536px) {
  /* Extra Large Desktop - maintain 5 columns with better spacing */
  #schoolGrid.grid-view {
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
  }
}

/* RESPONSIVE LIST VIEW OPTIMIZATION */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Tablet - Constrain list view image to prevent layout breakage */
  #schoolGrid.list-view .school-list-item {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
  }

  #schoolGrid.list-view .school-list-item > div:first-child {
    width: 140px !important;
    height: 100px !important;
    flex-shrink: 0;
  }

  #schoolGrid.list-view .school-list-item > div:nth-child(2) {
    flex: 1 1 calc(100% - 160px);
    min-width: 0;
  }

  #schoolGrid.list-view .school-list-item > div:last-child {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    flex-direction: row;
    margin-top: 0.5rem;
  }
}

@media (min-width: 1024px) {
  /* Laptop and up - Optimize list view for larger screens */
  #schoolGrid.list-view .school-list-item {
    display: grid;
    grid-template-columns: 250px 1fr auto;
    align-items: center;
    gap: 1.5rem;
  }

  #schoolGrid.list-view .school-list-item > div:first-child {
    width: 250px !important;
    height: 150px !important;
  }

  #schoolGrid.list-view .school-list-item > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 180px;
  }
}

@media (min-width: 1280px) {
  /* Large Desktop - Give more space to list view */
  #schoolGrid.list-view .school-list-item {
    grid-template-columns: 280px 1fr auto;
    gap: 2rem;
  }

  #schoolGrid.list-view .school-list-item > div:first-child {
    width: 280px !important;
    height: 170px !important;
  }
}
