/* style.css */
:root {
  --bg-dark: #141414;
  --bg-card: #181818;
  --accent-red: #e50914;
  --text-white: #ffffff;
  --text-gray: #a3a3a3;
  --glow-shadow: 0 8px 24px rgba(229, 9, 20, 0.4);
  --glass-bg: rgba(20, 20, 20, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);
  --ease-out-emil: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out-emil: cubic-bezier(0.77, 0, 0.175, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-white);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Visually Hidden Utility for Accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4%;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
  transition: background-color 0.3s ease;
}

.navbar.scrolled {
  background-color: #0b0b0b;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.school-name {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
}

.nav-links a {
  color: var(--text-gray);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-white);
}

.nav-search input {
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  outline: none;
  font-size: 0.8rem;
  font-family: inherit;
  width: 180px;
  transition: width 0.3s, border-color 0.3s;
}

.nav-search input:focus {
  width: 240px;
  border-color: var(--accent-red);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-btn-icon {
  background: none;
  border: none;
  color: var(--text-white);
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 160ms var(--ease-out-emil), opacity 160ms var(--ease-out-emil);
}

.nav-btn-icon:hover {
  opacity: 0.8;
}

.nav-btn-icon:active {
  transform: scale(0.92);
}

.nav-btn-icon::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--accent-red);
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

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

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 160ms var(--ease-out-emil), border-color 160ms var(--ease-out-emil);
}

.nav-avatar:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.5);
}

.nav-avatar:active {
  transform: scale(0.92);
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 16px;
    height: 60px;
  }
  .nav-links {
    display: none; /* Hide links on mobile viewports */
  }
  .nav-search input {
    width: 130px;
    padding: 5px 10px;
  }
  .nav-search input:focus {
    width: 160px;
  }
  .school-name {
    font-size: 0.95rem;
  }
  .logo-img {
    height: 32px;
  }
  .nav-right {
    gap: 12px;
  }
  .nav-avatar {
    width: 28px;
    height: 28px;
  }
  .nav-btn-icon {
    font-size: 1rem;
  }
}

/* Hero Section */
.hero {
  height: 85vh;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 4%;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(75deg, rgba(20,20,20,0.9) 35%, transparent 75%),
              linear-gradient(to top, var(--bg-dark) 0%, transparent 40%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.hero-n-label {
  background-color: var(--accent-red);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 2px;
}

.hero-type {
  font-size: 0.75rem;
  color: var(--text-gray);
  letter-spacing: 2px;
  font-weight: 600;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.hero-tagline {
  font-size: 1.2rem;
  color: var(--accent-red);
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.hero-desc {
  color: #e5e5e5;
  font-size: 0.95rem;
  margin-bottom: 24px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 160ms var(--ease-out-emil), background-color 160ms var(--ease-out-emil);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    transform: scale(1.05);
  }
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus,
.slider-arrow:focus,
.card-item:focus {
  outline: none;
}

.btn:focus-visible,
.slider-arrow:focus-visible,
.card-item:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--text-white);
  color: black;
}

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

.btn-secondary {
  background-color: rgba(109, 109, 110, 0.7);
  color: var(--text-white);
}

.btn-secondary:hover {
  background-color: rgba(109, 109, 110, 0.4);
}

.hero-actions {
  display: flex;
  gap: 12px;
}

/* Main Content Area */
.main-content {
  padding: 40px 4% 100px 4%;
  position: relative;
  z-index: 5;
  margin-top: -60px;
}

/* Category Rows */
.category-row {
  margin-bottom: 40px;
  position: relative;
}

.row-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-white);
}

.cards-slider-container {
  position: relative;
  display: flex;
  align-items: center;
}

.cards-slider {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 15px 0;
  width: 100%;
}

.cards-slider::-webkit-scrollbar {
  display: none; /* Hide scrollbars */
}

/* Scroll Chevron Buttons */
.slider-arrow {
  position: absolute;
  background: rgba(0,0,0,0.5);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 45px;
  height: calc(100% - 30px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity 160ms var(--ease-out-emil), background-color 160ms var(--ease-out-emil), transform 160ms var(--ease-out-emil);
}

.slider-arrow-left {
  left: -4%;
  border-radius: 0 4px 4px 0;
}

.slider-arrow-right {
  right: -4%;
  border-radius: 4px 0 0 4px;
}

.category-row:hover .slider-arrow {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .slider-arrow:hover {
    background: rgba(0,0,0,0.8);
  }
}

.slider-arrow:active {
  transform: scale(0.92);
}

/* Cards */
.card-item {
  flex: 0 0 calc(20% - 7px); /* 5 cards visible on desktop */
  aspect-ratio: 16/9;
  background-color: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 200ms var(--ease-out-emil), border-color 200ms var(--ease-out-emil);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  border: 1px solid transparent;
}

.card-item:active {
  transform: scale(0.97);
}

@media (max-width: 1024px) {
  .card-item { flex: 0 0 calc(33.33% - 6px); } /* 3 cards on tablet */
}
@media (max-width: 600px) {
  .card-item { flex: 0 0 calc(50% - 4px); } /* 2 cards on phone */
}

.card-image-box {
  width: 100%;
  height: 100%;
}

.card-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Card Details on Hover */
.card-info-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  opacity: 1;
  transition: background 0.25s var(--ease-out-emil);
}

@media (hover: hover) and (pointer: fine) {
  .card-item:hover {
    transform: scale(1.08);
    z-index: 10;
    border-color: rgba(255,255,255,0.4);
  }

  .card-item:hover .card-info-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.95) 30%, transparent 80%);
  }
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-white);
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  margin-bottom: 0;
  transition: margin-bottom 0.25s var(--ease-out-emil);
}

.card-item:hover .card-title {
  margin-bottom: 4px;
}

.card-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.7rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.25s var(--ease-out-emil), opacity 0.25s var(--ease-out-emil);
}

.card-item:hover .card-meta {
  max-height: 20px;
  opacity: 1;
}

.match-percent {
  color: #46d369;
  font-weight: bold;
}

.card-tag {
  background-color: rgba(255,255,255,0.2);
  padding: 1px 4px;
  border-radius: 2px;
  color: #fff;
}

/* Modal Overlay (Glassmorphism & Netflix style) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms var(--ease-out-emil);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  width: 90%;
  max-width: 750px;
  max-height: 90vh;
  background-color: var(--glass-bg);
  border-radius: 8px;
  overflow-y: auto;
  border: 1px solid var(--glass-border);
  position: relative;
  transform: scale(0.95);
  transition: transform 250ms var(--ease-out-emil);
}

.modal-overlay.open .modal-container {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  background-color: #181818;
  border: none;
  color: white;
  font-size: 1.1rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform 160ms var(--ease-out-emil), background-color 160ms var(--ease-out-emil);
}

.modal-close-btn:hover {
  background-color: #2a2a2a;
}

.modal-close-btn:active {
  transform: scale(0.92);
}

/* Header Banner Modal */
.modal-header-banner {
  height: 250px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 24px;
}

.modal-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #181818, transparent);
}

.modal-banner-title {
  position: relative;
  z-index: 2;
}

.modal-banner-title h2 {
  font-size: 2.2rem;
  font-weight: 800;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

/* Body Modal */
.modal-body {
  padding: 24px;
}

.modal-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

@media (max-width: 650px) {
  .modal-split { grid-template-columns: 1fr; gap: 20px; }
}

.modal-detail-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-stats {
  display: flex;
  gap: 12px;
  align-items: center;
}

.match-score {
  color: #46d369;
  font-weight: 800;
  font-size: 0.95rem;
}

.schedule-info {
  color: var(--text-gray);
  font-size: 0.9rem;
}

.modal-description {
  font-size: 0.95rem;
  color: #e5e5e5;
  line-height: 1.5;
}

/* Right column info */
.modal-detail-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-group {
  font-size: 0.85rem;
}

.info-label {
  color: var(--text-gray);
  display: block;
  margin-bottom: 2px;
}

.info-val {
  color: var(--text-white);
  font-weight: 600;
  white-space: pre-line;
}

.info-link {
  color: var(--accent-red);
  text-decoration: none;
}

.info-link:hover {
  text-decoration: underline;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.modal-tags span {
  background-color: #2b2b2b;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #ddd;
}

.btn-join {
  background-color: var(--accent-red);
  color: white;
  margin-top: 8px;
  font-weight: bold;
}

.btn-join:hover {
  background-color: #b80710;
}

/* Related grid */
.modal-related h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  font-weight: bold;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 500px) {
  .related-grid { grid-template-columns: 1fr; }
}

.related-card {
  background-color: #2f2f2f;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}

.related-card-img {
  height: 100px;
  background-size: cover;
  background-position: center;
}

.related-card-body {
  padding: 10px;
  font-size: 0.8rem;
}

.related-card-title {
  font-weight: bold;
  margin-bottom: 4px;
}

.related-card-desc {
  color: var(--text-gray);
  font-size: 0.7rem;
  line-height: 1.3;
  height: 3.9em;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Footer */
.footer {
  padding: 60px 4% 40px 4%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-gray);
  border-top: 1px solid #222;
  background-color: #0b0b0b;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-sub {
  opacity: 0.6;
}

/* Empty state search result */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-gray);
}

.empty-state-title {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text-white);
  font-weight: 600;
}

.empty-state-subtitle {
  font-size: 0.9rem;
}

/* Modal video play button overlay */
.modal-video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.6);
  border: 2px solid var(--text-white);
  color: var(--text-white);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.modal-video-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background-color: var(--accent-red);
  border-color: var(--accent-red);
  box-shadow: var(--glow-shadow);
}

.modal-video-play-btn:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 2px;
}

/* Card hover quick action buttons */
.card-hover-actions {
  display: flex;
  gap: 8px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-bottom: 0;
  transition: max-height 0.25s var(--ease-out-emil), opacity 0.25s var(--ease-out-emil), margin 0.25s var(--ease-out-emil);
}

.card-item:hover .card-hover-actions {
  max-height: 40px;
  opacity: 1;
  margin-top: 6px;
  margin-bottom: 8px;
}

.hover-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: transform 160ms var(--ease-out-emil), background-color 160ms var(--ease-out-emil);
}

@media (hover: hover) and (pointer: fine) {
  .hover-btn:hover {
    transform: scale(1.15);
  }
}

.hover-btn:active {
  transform: scale(0.95);
}

.hover-btn-play {
  background-color: var(--text-white);
  color: black;
}

.hover-btn-play:hover {
  background-color: #e2e2e2;
}

.hover-btn-detail {
  background-color: rgba(109, 109, 110, 0.7);
  color: var(--text-white);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.hover-btn-detail:hover {
  background-color: rgba(109, 109, 110, 0.4);
}

/* AI Chat Modal Styles */
.chat-container {
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.85);
}

.chat-bubble.user {
  align-self: flex-end;
  background-color: var(--accent-red);
  color: var(--text-white);
  padding: 10px 16px;
  border-radius: 14px;
  border-top-right-radius: 2px;
  max-width: 80%;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
  animation: fadeInBubble 250ms var(--ease-out-emil);
}

.chat-bubble.ai {
  animation: fadeInBubble 250ms var(--ease-out-emil);
}

@keyframes fadeInBubble {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-chip {
  transition: background-color 160ms var(--ease-out-emil), border-color 160ms var(--ease-out-emil), transform 160ms var(--ease-out-emil) !important;
}

.chat-chip:active {
  transform: scale(0.95) !important;
}

.chat-chip:hover {
  background-color: var(--accent-red) !important;
  border-color: var(--accent-red) !important;
}

#chat-input:focus {
  border-color: var(--accent-red) !important;
}

#chat-send-btn {
  transition: transform 160ms var(--ease-out-emil), background-color 160ms var(--ease-out-emil);
}

#chat-send-btn:active {
  transform: scale(0.9);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 10px 16px;
  background-color: #232323;
  border-radius: 12px;
  border-top-left-radius: 2px;
  width: fit-content;
  align-self: flex-start;
  margin-left: 44px;
  animation: fadeInBubble 200ms var(--ease-out-emil);
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-gray);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.3); opacity: 0.4; }
  40% { transform: scale(1.0); opacity: 1; }
}

/* Custom Scrollbar for Chat Messages */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
  background: #141414;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #404040;
}

/* School About Section */
.school-about-section {
  background: linear-gradient(180deg, #141414 0%, #0b0b0b 100%);
  padding: 80px 4% 60px 4%;
  color: var(--text-white);
  border-top: 1px solid #1f1f1f;
}

.school-about-container {
  max-width: 800px;
  margin: 0 auto;
}

.school-about-section h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 32px;
  color: var(--text-white);
  position: relative;
  display: inline-block;
  letter-spacing: -0.5px;
}

.school-about-section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 60px;
  height: 4px;
  background-color: var(--accent-red);
  border-radius: 2px;
}

.school-about-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.school-about-content p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #cccccc;
  text-align: justify;
}

@media (max-width: 768px) {
  .school-about-section {
    padding: 50px 20px 40px 20px;
  }
  .school-about-section h2 {
    font-size: 1.8rem;
    margin-bottom: 24px;
  }
  .school-about-content p {
    font-size: 0.95rem;
    line-height: 1.7;
    text-align: left;
  }
}


