:root {
  --bg-dark: #070D18;
  --bg-card: rgba(13, 27, 42, 0.7);
  --primary-cyan: #00F2FE;
  --primary-blue: #4FACFE;
  --accent-gold: #F39C12;
  --accent-green: #00E676;
  --text-main: #F0F4F8;
  --text-muted: #94A3B8;
  --text-bright: #FFFFFF;
  --border-light: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(0, 242, 254, 0.3);
  --font-main: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-heading: 'Outfit', system-ui, sans-serif;
  --font-cert: 'Cinzel', serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.5;
}

/* GATE WRAPPER */
.gate-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(0, 242, 254, 0.1) 0%, rgba(7, 13, 24, 0.98) 70%);
  padding: 1.5rem;
}

.gate-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 24px;
  max-width: 440px;
  width: 100%;
  padding: 3rem 2.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(15px);
  text-align: center;
}

.gate-logo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  color: #040D1A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 1.5rem auto;
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.4);
}

.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-bright); }
.form-input {
  width: 100%;
  padding: 0.9rem 1.2rem;
  background: rgba(4, 9, 20, 0.8);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  color: var(--text-bright);
  font-family: var(--font-main);
  font-size: 1rem;
}
.form-input:focus { outline: none; border-color: var(--primary-cyan); box-shadow: 0 0 15px rgba(0, 242, 254, 0.3); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue)); color: #040D1A; }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-gold { background: linear-gradient(135deg, #FFE066, var(--accent-gold)); color: #1A0F00; }
.btn-gold:hover { transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--text-bright); border: 1px solid var(--border-light); }
.btn-outline:hover { border-color: var(--primary-cyan); color: var(--primary-cyan); }

/* PORTAL HEADER */
.portal-header {
  background: rgba(4, 9, 20, 0.9);
  border-bottom: 1px solid var(--border-glow);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.portal-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.container { width: 90%; max-width: 1100px; margin: 0 auto; }

.portal-brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  color: #040D1A; display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}

.student-profile { display: flex; align-items: center; gap: 0.75rem; }
.profile-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(0, 242, 254, 0.15); color: var(--primary-cyan);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  border: 1px solid var(--border-glow);
}
.verified-badge { font-size: 0.75rem; color: var(--accent-green); font-weight: 700; }

/* PORTAL TABS */
.portal-tabs {
  display: flex;
  gap: 1rem;
  margin: 2.5rem 0 1.5rem 0;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
}

.portal-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.2s ease;
}

.portal-tab:hover, .portal-tab.active {
  background: rgba(0, 242, 254, 0.1);
  color: var(--primary-cyan);
}

.portal-content { display: none; margin-bottom: 4rem; }
.portal-content.active { display: block; }

.card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 2.5rem;
  backdrop-filter: blur(10px);
}

.tag-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
}
.tag-badge.green { background: rgba(0, 230, 118, 0.15); color: var(--accent-green); border: 1px solid var(--accent-green); }

.teams-cta-banner {
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.15) 0%, rgba(0, 242, 254, 0.05) 100%);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* MATERIALS */
.materials-grid { display: flex; flex-direction: column; gap: 1.25rem; }
.material-card {
  background: rgba(4, 9, 20, 0.7);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.material-icon {
  width: 50px; height: 50px; border-radius: 12px;
  background: rgba(0, 242, 254, 0.1); color: var(--primary-cyan);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0;
}
.material-icon.gold { background: rgba(243, 156, 18, 0.15); color: var(--accent-gold); }

/* APPS & AI TOOLS GRID */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.app-card {
  background: rgba(4, 9, 20, 0.8);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
}

.app-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 10px 25px rgba(0, 242, 254, 0.15);
}

.app-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.app-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(0, 242, 254, 0.1);
  color: var(--primary-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.app-card-category {
  font-size: 0.75rem;
  color: var(--accent-gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.app-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-bright);
}

.app-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex: 1;
}

/* VIDEO EMBED */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border-glow);
  background: #000;
}
.video-container iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

/* CERTIFICATE STYLING */
.certificate-paper {
  background: #FFFDF8;
  color: #1A1A1A;
  padding: 3rem;
  border-radius: 12px;
  margin-top: 2rem;
  box-shadow: 0 15px 40px rgba(0,0,0,0.5);
  font-family: var(--font-main);
  text-align: center;
  position: relative;
}

.cert-border-outer {
  border: 4px double #C5A059;
  padding: 1.5rem;
}

.cert-border-inner {
  border: 1px solid #D4AF37;
  padding: 2.5rem 1.5rem;
}

.cert-header {
  margin-bottom: 2rem;
}
.cert-logo-icon {
  font-size: 2.5rem;
  color: #0A192F;
  margin-bottom: 0.5rem;
}
.cert-institution {
  font-family: var(--font-cert);
  font-weight: 700;
  font-size: 1.5rem;
  color: #0A192F;
  letter-spacing: 2px;
}
.cert-subtext {
  font-size: 0.75rem;
  color: #C5A059;
  font-weight: 700;
  letter-spacing: 1px;
}

.cert-title {
  font-family: var(--font-cert);
  font-size: 2.2rem;
  font-weight: 700;
  color: #C5A059;
  margin: 1.5rem 0 0.5rem 0;
  letter-spacing: 3px;
}

.cert-granted {
  font-size: 1rem;
  color: #666;
  font-style: italic;
  margin-bottom: 1.5rem;
}

.cert-student-name {
  font-family: var(--font-cert);
  font-size: 2.5rem;
  font-weight: 700;
  color: #0A192F;
  border-bottom: 2px solid #C5A059;
  display: inline-block;
  padding: 0 2rem 0.5rem 2rem;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.cert-body {
  max-width: 650px;
  margin: 0 auto 2.5rem auto;
  font-size: 1.05rem;
  color: #444;
  line-height: 1.6;
}

.cert-signatures {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  margin-top: 3rem;
  padding: 0 2rem;
}

.signature-box {
  text-align: center;
}
.signature-line {
  width: 220px;
  border-bottom: 2px solid #333;
  margin-bottom: 0.5rem;
}
.signature-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #0A192F;
}
.signature-title {
  font-size: 0.8rem;
  color: #666;
}

.cert-seal {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFE066, #D4AF37);
  color: #1A0F00;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}
.cert-seal div { font-size: 0.65rem; font-weight: 800; }

.cert-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  font-size: 0.75rem;
  color: #888;
  border-top: 1px solid #EEE;
  padding-top: 1rem;
}

/* PRINT STYLES FOR CERTIFICATE */
@media print {
  body * { visibility: hidden; }
  #certificatePaper, #certificatePaper * { visibility: visible; }
  #certificatePaper {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    box-shadow: none;
  }
}
