/* ==========================================================================
   LMA (Lerne mit Andre) - Portal Belajar & Management System Styling
   Colors: Royal Blue (#1A56DB), Dark Blue (#0F3C9B), Red (#E53E3E), Yellow (#ECC94B)
   ========================================================================== */

:root {
  --primary: #1A56DB;
  --primary-dark: #0F3C9B;
  --primary-light: #EBF2FF;
  --accent-red: #E53E3E;
  --accent-red-light: #FED7D7;
  --accent-yellow: #ECC94B;
  --accent-yellow-light: #FEFCBF;
  --accent-green: #38A169;
  --accent-green-light: #C6F6D5;
  --dark: #1A202C;
  --gray: #4A5568;
  --gray-light: #EDF2F7;
  --white: #FFFFFF;
  --border: #E2E8F0;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 18px rgba(26, 86, 219, 0.08);
  --shadow-lg: 0 12px 30px rgba(26, 86, 219, 0.14);
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: #F8FAFC;
  color: var(--dark);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==================== TOP NAVIGATION ==================== */
.portal-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.portal-nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-title-group h1 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.2;
}

.brand-title-group p {
  font-size: 0.75rem;
  color: var(--gray);
  font-weight: 600;
}

.portal-nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--gray);
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  color: var(--primary);
  background-color: var(--primary-light);
}

.nav-item i {
  font-size: 1.15rem;
}

.user-badge-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--gray-light);
  padding: 0.35rem 0.85rem 0.35rem 0.4rem;
  border-radius: var(--radius-full);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 1px solid var(--border);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

.user-role-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: capitalize;
}

.btn-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--accent-red);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: var(--accent-red-light);
  border-color: var(--accent-red);
}

/* ==================== MAIN CONTAINER ==================== */
.portal-main {
  max-width: 1200px;
  margin: 1.75rem auto 3.5rem auto;
  padding: 0 1.25rem;
}

/* ==================== HERO GREETING BANNER ==================== */
.greeting-banner {
  background: linear-gradient(135deg, #0F3C9B 0%, #1A56DB 70%, #2563EB 100%);
  color: var(--white);
  padding: 2.25rem 2.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.greeting-banner::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(236, 201, 75, 0.25), transparent 70%);
  border-radius: 50%;
}

.greeting-banner::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: 20%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(229, 62, 62, 0.2), transparent 70%);
  border-radius: 50%;
}

.greeting-text {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.greeting-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.greeting-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.greeting-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.88);
}

.greeting-action {
  position: relative;
  z-index: 2;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(26, 86, 219, 0.25);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26, 86, 219, 0.35);
}

.btn-danger {
  background: var(--accent-red);
  color: var(--white);
}

.btn-danger:hover {
  background: #C53030;
  transform: translateY(-2px);
}

.btn-yellow {
  background: var(--accent-yellow);
  color: #744210;
  font-weight: 800;
}

.btn-yellow:hover {
  background: #D69E2E;
  color: #553008;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--dark);
}

.btn-outline:hover {
  background: var(--gray-light);
  border-color: var(--gray);
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

/* ==================== LIVE ALERT CARD ==================== */
.live-alert-card {
  background: linear-gradient(135deg, #FFF5F5 0%, #FED7D7 100%);
  border: 2px solid #FEB2B2;
  border-radius: var(--radius-md);
  padding: 1.15rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
  0%, 100% { border-color: #FEB2B2; }
  50% { border-color: #E53E3E; }
}

.live-alert-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.live-badge-glow {
  background: var(--accent-red);
  color: var(--white);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  animation: blinkLive 1.5s infinite;
}

@keyframes blinkLive {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--white);
  border-radius: 50%;
}

/* ==================== GRID SECTION ==================== */
.section-heading-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.section-link:hover {
  text-decoration: underline;
}

/* 4 Feature Action Cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.card-icon-bubble {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.card-icon-bubble.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.card-icon-bubble.red {
  background: var(--accent-red-light);
  color: var(--accent-red);
}

.card-icon-bubble.yellow {
  background: var(--accent-yellow-light);
  color: #D69E2E;
}

.card-icon-bubble.green {
  background: var(--accent-green-light);
  color: var(--accent-green);
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  color: var(--dark);
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--gray);
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

/* ==================== MODULE CARDS ==================== */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.modul-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.modul-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.modul-card-header {
  padding: 1.25rem 1.25rem 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modul-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.modul-badge.jerman {
  background: #EBF8FF;
  color: #2B6CB0;
}

.modul-badge.matematika {
  background: #FEFCBF;
  color: #744210;
}

.modul-card-body {
  padding: 0 1.25rem 1.25rem 1.25rem;
  flex-grow: 1;
}

.modul-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.modul-card-desc {
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modul-card-footer {
  padding: 0.85rem 1.25rem;
  background: #F8FAFC;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray);
}

/* ==================== FILTER TABS ==================== */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.filter-btn {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gray);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* ==================== QUIZ & ATTENDANCE CARDS ==================== */
.quiz-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.quiz-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.quiz-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--gray);
  margin-top: 0.35rem;
}

/* Big 1-Click Absen Box */
.absen-hero-box {
  background: var(--white);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.clock-live-text {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 0.5rem 0 1rem 0;
}

.absen-btn-huge {
  background: linear-gradient(135deg, #1A56DB 0%, #0F3C9B 100%);
  color: var(--white);
  border: none;
  font-size: 1.25rem;
  font-weight: 800;
  padding: 1.15rem 2.5rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(26, 86, 219, 0.35);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.absen-btn-huge:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 30px rgba(26, 86, 219, 0.45);
}

.absen-btn-huge.checked {
  background: linear-gradient(135deg, #38A169 0%, #2F855A 100%);
  cursor: default;
  transform: none;
}

/* ==================== DATA TABLES ==================== */
.table-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: #F8FAFC;
  padding: 0.9rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.9rem 1.25rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  color: var(--dark);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #F8FAFC;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.status-chip.hadir {
  background: var(--accent-green-light);
  color: #22543D;
}

.status-chip.izin {
  background: var(--accent-yellow-light);
  color: #744210;
}

.status-chip.sakit {
  background: var(--accent-red-light);
  color: #742A2A;
}

/* ==================== MODAL OVERLAY ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: translateY(20px);
  transition: all 0.25s ease;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray);
  line-height: 1;
}

.modal-body {
  padding: 1.75rem;
}

.modal-footer {
  padding: 1rem 1.75rem;
  background: #F8FAFC;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==================== LOGIN PAGE SPECIAL ==================== */
.auth-page-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(circle at 10% 20%, #EBF2FF 0%, #F8FAFC 90%);
}

.auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 15px 40px rgba(26, 86, 219, 0.12);
  text-align: center;
}

.auth-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.auth-card h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 0.35rem;
}

.auth-card p.subtitle {
  font-size: 0.88rem;
  color: var(--gray);
  margin-bottom: 1.75rem;
}

.form-group {
  text-align: left;
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--dark);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.9rem;
  color: var(--dark);
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.15);
}

.quick-demo-box {
  background: var(--primary-light);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 1.5rem;
  text-align: left;
}

.quick-demo-box p {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.quick-demo-btns {
  display: flex;
  gap: 0.5rem;
}

/* ==================== TOAST NOTIFICATION ==================== */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideInToast 0.3s ease;
}

.toast-msg.success {
  background: #276749;
  color: var(--white);
}

.toast-msg.error {
  background: #C53030;
  color: var(--white);
}

@keyframes slideInToast {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .portal-nav-links {
    display: none;
  }
  
  .greeting-banner {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    padding: 1.75rem 1.5rem;
  }

  .live-alert-card {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .quiz-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .d-none-sm {
    display: none !important;
  }
}

@keyframes modalPop {
  from {
    transform: scale(0.95) translateY(10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}
