/* =========================================
   CCRC IT Club - Premium Result Portal
   Design Language: Minimal, Moderately Rounded, Dark, Premium Yellow
   ========================================= */

/* -----------------------------------------
   1. Variables
   ----------------------------------------- */
:root {
  /* Colors - Minimal Dark Theme */
  --bg-color: #050505;
  --surface-main: #0a0a0a;
  --surface-2: #121212;
  --surface-modal: #0f0f0f;
  
  /* Typography - Inverted for dark mode */
  --text-dark: #F5F5F5;
  --text-body: #A3A3A3;
  --text-light: #737373;
  
  /* Accents - Premium Yellow / Gold */
  --primary: #F5B014;        
  --primary-hover: #D99B10;
  --primary-transparent: rgba(245, 176, 20, 0.1);
  
  /* Borders & UI */
  --border: #262626;
  --border-highlight: #404040;
  --border-active: #F5B014;
  
  /* Shadows - Extremely subtle */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.8);
  
  /* Radii - Rounded, but not too much (Linear style) */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Transitions */
  --ease-spring: cubic-bezier(0.25, 1, 0.35, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* -----------------------------------------
   2. Reset & Global
   ----------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

/* Utility for accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* -----------------------------------------
   3. Typography
   ----------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-dark);
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 8px;
}

h2 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h4 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px;
}

.subtitle {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-body);
  margin-bottom: 12px;
}

.hero-desc, p {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-body);
}

.small-text, .card-footer, .badge, .publish-date {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* -----------------------------------------
   4. Background & Decorative
   ----------------------------------------- */
/* Kept intentionally minimal without neon glows */
.page-bg-glow, .card-glow {
  display: none !important; 
}

/* -----------------------------------------
   5. Layout
   ----------------------------------------- */
.center-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  z-index: 2;
}

/* -----------------------------------------
   6. Landing Page
   ----------------------------------------- */
.result-card-wrap {
  position: relative;
  width: 100%;
  max-width: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-card {
  width: 100%;
  background: var(--surface-main);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  position: relative;
  z-index: 2;
  overflow: hidden;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.6s var(--ease-spring), transform 0.6s var(--ease-spring), border-color 0.4s ease;
}

.result-card.show {
  opacity: 1;
  transform: translateY(0);
}

.result-card:hover {
  border-color: var(--border-highlight);
}

.card-inner {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
}

/* Animated Logo (Landing Page) */
.icon {
  width: 96px; /* Increased size */
  height: 96px; /* Increased size */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-logo {
  height: 76px; /* Noticeably larger */
  width: auto;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.95);
  transition: transform 0.6s var(--ease-spring), opacity 0.6s ease;
  /* filter: grayscale(100%) brightness(200%); */
}

.card-logo.logo-enter {
  opacity: 1;
  transform: scale(1);
}

/* -----------------------------------------
   7. Buttons & Form Elements
   ----------------------------------------- */
.btn-gradient {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-md); /* Moderately rounded */
  border: none;
  background: var(--primary);
  color: #000000;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  outline: none;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-gradient:hover {
  background: var(--primary-hover);
}

.btn-gradient:active {
  transform: scale(0.98);
}

.btn-label {
  position: relative;
  z-index: 3;
  transition: opacity 0.3s ease;
}

/* Loading & Ripple states */
.btn-gradient.loading .btn-label {
  opacity: 0;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.15);
  z-index: 2;
}

.ripple.animate {
  animation: rippleAnim 0.6s var(--ease-smooth);
}

.loader {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000000;
  opacity: 0;
  left: calc(50% - 10px);
  top: calc(50% - 10px);
  transition: opacity 0.2s ease;
  z-index: 4;
}

.btn-gradient.loading .loader {
  opacity: 1;
  animation: spin 0.8s linear infinite;
}

/* -----------------------------------------
   8. Hero Section (Results Page)
   ----------------------------------------- */
.hero {
  position: relative;
  padding: 64px 20px 48px;
  z-index: 2;
}

/* Results Page Logo (Second Page) */
.club-logo {
  height: 64px;
  width: auto;
  object-fit: contain;
  margin-bottom: 24px;
  display: block;
  filter: grayscale(100%) brightness(200%);
  transition: transform 0.6s var(--ease-spring);
}

.club-logo:hover {
  transform: scale(1.05);
}

.glass-card {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--surface-main);
  border-radius: var(--radius-lg); /* Moderately rounded */
  padding: 48px;
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.6s var(--ease-spring);
}

.glass-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: center;
}

.hero-left, .hero-right {
  opacity: 0;
  transition: all 0.6s var(--ease-spring);
}

.hero-left { transform: translateX(-15px); }
.hero-right { transform: translateX(15px); }
.hero-left.is-visible, .hero-right.is-visible { opacity: 1; transform: translateX(0); }

.badge-small {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary-transparent);
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid var(--primary-transparent);
}

/* Redesigned Premium Trophy Container */
.hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.trophy-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* A subtly rounded premium container for the medal/award */
.trophy-circle {
  width: 110px;
  height: 110px;
  border-radius: var(--radius-lg); 
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 0.4s ease, transform 0.4s var(--ease-spring);
}

.trophy-circle:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.trophy {
  font-size: 0; 
}
.trophy::after {
  content: "✦";
  font-size: 48px;
  color: var(--primary);
}

.caption-strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

/* -----------------------------------------
   9. Search
   ----------------------------------------- */
.search-pill {
  display: inline-flex;
  align-items: center;
  width: 280px;
  background: var(--surface-2);
  border-radius: var(--radius-md); /* Moderately rounded */
  padding: 12px 16px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  margin-top: 24px;
}

.search-pill input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-dark);
  flex: 1;
  font-family: inherit;
}

.search-pill input::placeholder {
  color: var(--text-light);
}

.search-pill:focus-within {
  width: 320px;
  border-color: var(--primary);
}

.search-pill .search-icon {
  color: var(--text-light);
}

/* -----------------------------------------
   10. Gallery & Cards
   ----------------------------------------- */
.gallery-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 40px 64px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}

.card-wrap {
  position: relative;
}

.card {
  background: var(--surface-2);
  border-radius: var(--radius-lg); /* Moderately rounded */
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: transform 0.4s var(--ease-spring), border-color 0.3s ease;
}

.card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
}

.card .media {
  aspect-ratio: 4/5;
  background-size: cover;
  background-position: center;
  transition: filter 0.4s ease;
  cursor: pointer;
  filter: grayscale(20%);
}

.card:hover .media {
  filter: grayscale(0%);
}

.card .overlay {
  display: none; 
}

/* Card Metadata */
.card .meta {
  padding: 16px;
  background: var(--surface-2);
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
}

.card .art-title {
  color: var(--text-light);
  font-size: 13px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-color);
  border: 1px solid var(--border);
  color: var(--text-dark);
  font-size: 11px;
}

.actions {
  margin-top: 16px;
}

.view-image {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-light);
  font-weight: 500;
  text-decoration: none;
  font-size: 12px;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.view-image:hover {
  background: var(--text-dark);
  color: var(--bg-color);
  border-color: var(--text-dark);
}

/* -----------------------------------------
   11. Modal & Lightbox
   ----------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  max-width: 1200px;
  width: 90%;
  max-height: 90vh;
  background: var(--surface-modal);
  border-radius: var(--radius-xl);
  padding: 32px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  z-index: 101;
  border: 1px solid var(--border);
  overflow-y: auto;
  opacity: 0;
  transform: scale(0.98);
  animation: modalReveal 0.3s var(--ease-smooth) forwards;
}

.modal-media {
  background-color: var(--surface-2);
  border-radius: var(--radius-md);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  min-height: 500px;
  border: 1px solid var(--border);
}

.modal-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-meta h3 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.meta-row {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.meta-row:last-child {
  border-bottom: none;
}

.meta-row strong {
  display: block;
  font-size: 11px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.meta-row span {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.6;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--primary);
}

/* Fullscreen handling */
.modal.fullscreen .modal-panel {
  grid-template-columns: 1fr;
  padding: 12px;
  background: transparent;
  border: none;
  max-width: 95vw;
}

.modal.fullscreen .modal-meta {
  display: none;
}

.modal.fullscreen .modal-media {
  min-height: 85vh;
  background-color: transparent;
  border: none;
}

.modal.fullscreen .modal-close {
  top: 16px;
  right: 16px;
  background: var(--bg-color);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* Fallback Lightbox (Results Page Native) */
.lightbox.open { display: flex; }

/* -----------------------------------------
   12. Footer
   ----------------------------------------- */
.site-footer {
  padding: 40px 20px;
  text-align: center;
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  background: var(--bg-color);
}

.back-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-md); /* Moderately rounded */
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
  margin-bottom: 24px;
}

.back-home:hover {
  background: var(--bg-color);
  border-color: var(--primary);
  color: var(--primary);
}

/* -----------------------------------------
   13. Scrollbar & Selection & Focus
   ----------------------------------------- */
::selection {
  background: var(--primary);
  color: #000;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-left: 1px solid var(--border);
}

::-webkit-scrollbar-thumb {
  background: var(--border-highlight);
  border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.card:focus-within {
  outline: none;
}

/* -----------------------------------------
   14. Animations
   ----------------------------------------- */
@keyframes rippleAnim {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(20); opacity: 0; }
}

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

@keyframes modalReveal {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* -----------------------------------------
   15. Media Queries (Responsive)
   ----------------------------------------- */
@media (max-width: 1280px) {
  .gallery { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1024px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 48px;
  }
  .hero-left, .hero-right {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .search-pill { margin: 24px auto 0; }
}

@media (max-width: 768px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .modal-panel {
    grid-template-columns: 1fr;
    max-height: 85vh;
    padding: 24px;
    gap: 24px;
  }
  .modal-media { min-height: 300px; }
  h1 { font-size: 32px; }
}

@media (max-width: 540px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery-shell { padding: 16px 20px; }
  .glass-card { padding: 32px 20px; }
  .search-pill { width: 100%; }
  .search-pill:focus-within { width: 100%; }
  .card-inner { padding: 32px 24px; }
}

@media (max-width: 380px) {
  h1 { font-size: 26px; }
  .btn-gradient { height: 48px; }
  .trophy-circle { width: 80px; height: 80px; }
  .trophy::after { font-size: 36px; }
  .card-logo { height: 60px; }
}