/* ==========================================================================
   Pertandingan Idea Generation AI
   Tema: Pembelajaran Kreatif AI | Perpustakaan Negeri Sabah (PNSC Tanjung Aru)
   Theme: Mint Emerald & Ultra Mobile Responsive System
   ========================================================================== */

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

:root {
  --bg-primary: #081c15;
  --bg-secondary: #0d281e;
  --bg-card: rgba(13, 40, 30, 0.85);
  --bg-card-hover: rgba(20, 58, 43, 0.95);
  --glass-border: rgba(52, 211, 153, 0.25);
  --glass-border-hover: rgba(52, 211, 153, 0.6);
  
  --emerald-main: #10b981;
  --emerald-light: #34d399;
  --emerald-dark: #047857;
  --mint-bg: #d1fae5;
  --gold-accent: #fbbf24;
  --cyan-accent: #06b6d4;
  
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dark: #0f172a;
  
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --glow-emerald: 0 0 20px rgba(16, 185, 129, 0.4);
  --glow-gold: 0 0 20px rgba(251, 191, 36, 0.4);
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
}

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  overflow-wrap: break-word;
  word-break: break-word;
}

p, li, span, label {
  font-family: var(--font-body);
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Long text & email breaker utility */
.email-text, .text-break {
  word-break: break-all;
  overflow-wrap: anywhere;
  display: inline-block;
  color: var(--emerald-light);
  font-weight: 700;
}

.text-gradient-emerald {
  background: linear-gradient(135deg, #6ee7b7, #10b981, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-gold {
  background: linear-gradient(135deg, #fef08a, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glassmorphism Containers */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: var(--transition);
}

.glass-panel:hover {
  border-color: var(--glass-border-hover);
  box-shadow: 0 12px 35px rgba(16, 185, 129, 0.2);
}

/* Badges */
.badge-emerald {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--emerald-light);
  color: var(--emerald-light);
  white-space: nowrap;
}

.badge-gold {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--gold-accent);
  color: var(--gold-accent);
}

/* Navigasi Header */
header.cyber-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0.75rem 1.5rem;
  background: rgba(8, 28, 21, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(52, 211, 153, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  max-width: 70%;
}

.logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
  background: #ffffff;
  padding: 3px 10px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: var(--transition);
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: var(--emerald-light);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  padding: 0.4rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--emerald-light);
}

/* Butang Mobile Touch-Friendly */
.btn-emerald {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  min-height: 44px;
}

.btn-emerald-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-emerald-primary:hover, .btn-emerald-primary:active {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
  background: linear-gradient(135deg, #34d399, #10b981);
}

.btn-emerald-outline {
  background: transparent;
  color: #fff;
  border: 1px solid var(--emerald-light);
}

.btn-emerald-outline:hover, .btn-emerald-outline:active {
  background: rgba(16, 185, 129, 0.15);
}

.mobile-menu-btn {
  display: none;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--emerald-light);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Seksyen */
section {
  padding: 4.5rem 1.5rem;
  max-width: 1240px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 0.6rem;
}

.section-header p {
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
  font-size: 0.98rem;
}

/* Hero Section */
.hero-section {
  padding-top: 7rem;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
  width: 100%;
}

.hero-visual-container {
  width: 100%;
}

.hero-content h1 {
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

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

.highlight-box {
  padding: 1rem;
  border-radius: 12px;
  background: rgba(13, 40, 30, 0.8);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.highlight-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--emerald-light);
  color: var(--emerald-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.highlight-icon.gold {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--gold-accent);
  color: var(--gold-accent);
}

.highlight-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.highlight-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

/* Steps Cards Grid (#cara-hantar) Spacing Fix */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem 1.25rem;
  margin-top: 3.5rem; /* Sufficient top space so header text never blocks LANGKAH badges */
}

.step-card {
  padding: 2rem 1.25rem 1.5rem 1.25rem;
  text-align: center;
  position: relative;
}

.step-badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--emerald-light);
  color: var(--text-dark);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 4px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  z-index: 10;
}

.step-badge.gold {
  background: var(--gold-accent);
}

/* Rules Grid - Centered Content Inside Cards */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.rule-card {
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.rule-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--emerald-light);
  color: var(--emerald-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.rule-content {
  width: 100%;
  text-align: center;
  min-width: 0;
}

.rule-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  text-align: center;
  word-break: break-word;
  overflow-wrap: break-word;
}

.rule-content p {
  font-size: 0.92rem;
  color: var(--text-muted);
  text-align: center;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Criteria Grid */
.criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.criteria-card {
  padding: 1.75rem 1.25rem;
  text-align: center;
  min-width: 0;
}

.criteria-card.featured {
  border-color: var(--gold-accent);
  background: rgba(251, 191, 36, 0.08);
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.2);
}

.criteria-percent {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--emerald-light);
  margin-bottom: 0.4rem;
}

.criteria-card.featured .criteria-percent {
  color: var(--gold-accent);
}

.criteria-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.criteria-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Form & Input Mobile Optimization */
.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(8, 28, 21, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--emerald-light);
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.3);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Form Container Layout */
.form-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

/* FAQ Accordion */
.faq-container {
  max-width: 820px;
  margin: 0 auto;
}

.faq-item {
  margin-bottom: 0.85rem;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: var(--bg-card);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1.1rem 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 600;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  gap: 0.75rem;
}

.faq-question i {
  color: var(--emerald-light);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 1.25rem 1.1rem 1.25rem;
}

/* Contact Card */
.contact-card {
  text-align: center;
  padding: 2rem 1.25rem;
  margin-top: 2.5rem;
  border-color: var(--emerald-light);
}

.contact-buttons {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

/* Footer */
footer {
  background: #04120d;
  border-top: 1px solid rgba(52, 211, 153, 0.2);
  padding: 3.5rem 1.5rem 1.5rem 1.5rem;
}

.footer-content {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 1rem;
  font-size: 0.9rem;
  max-width: 420px;
}

.footer-links h4 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--emerald-light);
}

.footer-bottom {
  max-width: 1240px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  left: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--emerald-light);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  box-shadow: var(--glow-emerald);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: auto;
  max-width: 420px;
  margin-left: auto;
  font-size: 0.88rem;
}

/* Media Queries - Mobile Responsive with Poster First Order */
@media (max-width: 992px) {
  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .hero-visual-container {
    order: -1;
    width: 100%;
  }

  .hero-content {
    order: 1;
    width: 100%;
  }
  
  .form-layout-grid, .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .hero-content h1 {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  header.cyber-nav {
    padding: 0.7rem 1rem;
  }

  .logo-title {
    font-size: 0.82rem;
  }

  .logo-subtitle {
    display: none;
  }

  .logo-img {
    height: 36px;
    padding: 2px 8px;
  }

  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(8, 28, 21, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1.75rem 1.25rem;
    gap: 1rem;
    border-bottom: 1px solid var(--glass-border);
    transform: translateY(-150%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }

  .nav-links.active {
    transform: translateY(0);
  }

  .mobile-menu-btn {
    display: flex;
  }

  section {
    padding: 3.5rem 1rem;
  }

  .hero-section {
    padding-top: 5.5rem;
  }

  .highlights-grid {
    grid-template-columns: 1fr;
  }

  .steps-grid {
    margin-top: 3rem;
  }

  .contact-buttons a, .btn-emerald {
    width: 100%;
  }

  .form-group-row {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .hero-content h1 {
    font-size: 1.75rem;
  }

  .hero-description {
    font-size: 0.95rem;
  }

  .badge-emerald {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
  }

  .glass-panel {
    padding: 1.25rem !important;
    border-radius: 12px;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
  
  .toast {
    max-width: 100%;
  }
}
