/* ==========================================================================
   Fanfare & Celebration Styles — Raspidanie BSUFL Finale
   ========================================================================== */

:root {
  --bg-color: #070913;
  --bg-gradient: radial-gradient(circle at 50% 20%, #171c38 0%, #080a14 70%, #030408 100%);
  --card-bg: rgba(22, 27, 49, 0.75);
  --card-border: rgba(245, 158, 11, 0.25);
  --card-glow: 0 12px 40px -10px rgba(245, 158, 11, 0.2);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-accent: #fbbf24;
  
  --gold-start: #fbbf24;
  --gold-end: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.5);

  --btn-primary-bg: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  --btn-primary-hover: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  --btn-secondary-bg: rgba(255, 255, 255, 0.08);
  --btn-secondary-border: rgba(255, 255, 255, 0.15);
  --btn-secondary-hover: rgba(255, 255, 255, 0.16);

  --badge-bg: rgba(245, 158, 11, 0.12);
  --badge-border: rgba(245, 158, 11, 0.35);
  --badge-text: #fcd34d;
}

[data-theme="light"] {
  --bg-color: #f8fafc;
  --bg-gradient: radial-gradient(circle at 50% 10%, #fef3c7 0%, #f1f5f9 60%, #e2e8f0 100%);
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(217, 119, 6, 0.2);
  --card-glow: 0 12px 35px -8px rgba(217, 119, 6, 0.18);
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-accent: #b45309;

  --btn-secondary-bg: rgba(0, 0, 0, 0.05);
  --btn-secondary-border: rgba(0, 0, 0, 0.12);
  --btn-secondary-hover: rgba(0, 0, 0, 0.1);

  --badge-bg: rgba(245, 158, 11, 0.15);
  --badge-border: rgba(245, 158, 11, 0.4);
  --badge-text: #92400e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-color);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Canvas confetti overlay */
#celebration-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
}

/* Floating caps and hearts container */
#floating-caps-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 998;
  overflow: hidden;
}

.flying-cap, .flying-heart {
  position: absolute;
  bottom: -60px;
  animation: floatUp cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
  will-change: transform, opacity;
  user-select: none;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0deg) scale(0.6);
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translateY(-110vh) rotate(var(--target-rotation, 360deg)) scale(1.15);
    opacity: 0;
  }
}

/* Header & Controls */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0.5rem;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-accent);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-brand span {
  background: linear-gradient(135deg, var(--gold-start), var(--gold-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-btn {
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  color: var(--text-main);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.icon-btn:hover {
  background: var(--btn-secondary-hover);
  transform: translateY(-2px);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.icon-btn.muted svg.sound-on {
  display: none;
}

.icon-btn:not(.muted) svg.sound-off {
  display: none;
}

[data-theme="dark"] .theme-icon-dark {
  display: none;
}
[data-theme="light"] .theme-icon-light {
  display: none;
}

/* Main Container */
.page-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 10;
}

/* Grand Hero Badge */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  padding: 0.45rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
  animation: pulseGlow 2.5s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
  }
  50% {
    box-shadow: 0 0 28px rgba(245, 158, 11, 0.45);
  }
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Hero Titles */
.hero-title {
  text-align: center;
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: 1.2rem;
  letter-spacing: -0.02em;
}

.gold-shimmer {
  background: linear-gradient(120deg, #f59e0b 0%, #fde68a 35%, #f59e0b 70%, #d97706 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 4s linear infinite;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

.hero-subtitle {
  text-align: center;
  font-size: clamp(1.1rem, 2.8vw, 1.4rem);
  color: var(--text-muted);
  max-width: 680px;
  margin-bottom: 2.5rem;
  font-weight: 400;
}

.hero-subtitle strong {
  color: var(--text-main);
}

/* Master Fanfare Trigger */
.fanfare-action-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 3.5rem;
  width: 100%;
}

.big-fanfare-button {
  background: var(--btn-primary-bg);
  color: #1a0f00;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  border: none;
  border-radius: 18px;
  padding: 1.15rem 2.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  box-shadow: 0 10px 30px -5px var(--gold-glow), 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.big-fanfare-button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 60%
  );
  transform: rotate(25deg);
  animation: lightSweep 4s infinite;
}

@keyframes lightSweep {
  0% { transform: translateX(-100%) rotate(25deg); }
  25%, 100% { transform: translateX(100%) rotate(25deg); }
}

.big-fanfare-button:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 15px 40px -5px var(--gold-glow), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

.big-fanfare-button:active {
  transform: translateY(1px) scale(0.98);
}

.big-fanfare-button .icon-trumpet {
  font-size: 1.6rem;
  animation: trumpetShake 1.8s infinite ease-in-out;
}

@keyframes trumpetShake {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-12deg) scale(1.1); }
  30% { transform: rotate(12deg) scale(1.1); }
  45% { transform: rotate(-6deg); }
  60% { transform: rotate(0deg); }
}

.button-hint {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Secondary Interactive Buttons */
.sub-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 0.5rem;
}

.sub-btn {
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  color: var(--text-main);
  padding: 0.75rem 1.4rem;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.sub-btn:hover {
  background: var(--btn-secondary-hover);
  border-color: var(--card-border);
  transform: translateY(-2px);
}

.sub-btn:active {
  transform: translateY(0);
}

.counter-badge {
  background: rgba(245, 158, 11, 0.2);
  color: var(--badge-text);
  font-size: 0.8rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.counter-badge.pulse {
  transform: scale(1.3);
}

/* Tribute Card */
.tribute-card {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-glow);
  border-radius: 24px;
  padding: 2.2rem 2.4rem;
  backdrop-filter: blur(16px);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.tribute-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f59e0b, #ec4899, #3b82f6, #10b981, #f59e0b);
}

.card-header-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.diploma-icon {
  font-size: 2.2rem;
  background: rgba(245, 158, 11, 0.15);
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-header-badge h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.tribute-text {
  font-size: 1.06rem;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.tribute-text:last-of-type {
  margin-bottom: 2rem;
}

/* Highlight Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.stat-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 1.1rem;
  text-align: center;
}

[data-theme="light"] .stat-item {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

.stat-emoji {
  font-size: 1.7rem;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.stat-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-accent);
}

/* Footer note */
.farewell-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 600px;
}

.farewell-footer p {
  margin-bottom: 0.75rem;
}

.farewell-footer .final-signature {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .page-container {
    padding: 1.25rem 1rem 3rem;
  }
  .tribute-card {
    padding: 1.6rem 1.25rem;
    border-radius: 20px;
  }
  .big-fanfare-button {
    width: 100%;
    justify-content: center;
    padding: 1.1rem 1.5rem;
  }
  .sub-actions {
    flex-direction: column;
    width: 100%;
  }
  .sub-btn {
    width: 100%;
    justify-content: center;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
