/* 
 * Custom Stylesheet - Aplikasi Porseni Madrasah
 * Theme: Modern Emerald & Royal Gold with Madrasah Sport Aesthetic
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #10b981;
  --gold: #d97706;
  --gold-light: #fbbf24;
  --dark: #0f172a;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: #1e293b;
  background-color: #f8fafc;
}

/* Glassmorphism Effect */
.glass-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-nav {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Medal Badges & Shimmer */
.medal-gold {
  background: linear-gradient(135deg, #fef08a 0%, #eab308 50%, #ca8a04 100%);
  color: #713f12;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.35);
}
.medal-silver {
  background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 50%, #94a3b8 100%);
  color: #334155;
  box-shadow: 0 4px 12px rgba(148, 163, 184, 0.35);
}
.medal-bronze {
  background: linear-gradient(135deg, #fed7aa 0%, #f97316 50%, #c2410c 100%);
  color: #7c2d12;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35);
}

/* Tournament Bracket CSS */
.bracket-container {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  padding: 24px 8px;
  gap: 32px;
}
.bracket-round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  min-width: 260px;
}
.bracket-match {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin: 12px 0;
  overflow: hidden;
  position: relative;
  transition: all 0.2s ease;
}
.bracket-match:hover {
  border-color: #10b981;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.15);
}
.bracket-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 0.875rem;
}
.bracket-team:first-child {
  border-bottom: 1px solid #f1f5f9;
}
.bracket-team.winner {
  background-color: #ecfdf5;
  font-weight: 700;
  color: #065f46;
}

/* ID Card Styles */
.id-card-wrapper {
  width: 320px;
  min-height: 480px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
}
.id-card-header {
  background: linear-gradient(135deg, #065f46 0%, #047857 60%, #059669 100%);
  color: #ffffff;
  padding: 20px 16px;
  text-align: center;
  position: relative;
}
.id-card-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  object-fit: cover;
  margin: -48px auto 12px auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  background: #f1f5f9;
}

/* Certificate Styles */
.cert-container {
  width: 1050px;
  height: 742px; /* Standard A4 aspect ratio in pixels (1.414) */
  background: #ffffff;
  margin: 0 auto;
  position: relative;
  box-sizing: border-box;
  padding: 30px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}
.cert-border-outer {
  border: 4px solid #d97706;
  height: 100%;
  width: 100%;
  padding: 12px;
  box-sizing: border-box;
  position: relative;
}
.cert-border-inner {
  border: 2px solid #059669;
  height: 100%;
  width: 100%;
  padding: 30px 40px;
  box-sizing: border-box;
  text-align: center;
  position: relative;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
}
.cert-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.05;
  width: 380px;
  pointer-events: none;
}

/* Print Rules */
@media print {
  body {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .no-print {
    display: none !important;
  }
  .cert-container {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    page-break-after: always;
  }
  @page {
    size: A4 landscape;
    margin: 5mm;
  }
}
