/* Extracted styles from index.html for maintainability. */

/* Base typography and background */
body {
  font-family: "Poppins", sans-serif;
  background-color: #050210;
  color: #cbd5e1;
  overflow: hidden;
}

/* Animated background blobs */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  filter: blur(100px);
}
.animated-bg::before,
.animated-bg::after {
  content: "";
  position: absolute;
  width: 40vmax;
  height: 40vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43, 174, 226, 0.4), transparent 60%);
  animation: move 25s infinite linear alternate;
}
.animated-bg::after {
  background: radial-gradient(circle, rgba(43, 174, 226, 0.4), transparent 60%);
  bottom: -20vmax;
  right: -20vmax;
  animation-delay: -12s;
}
@keyframes move {
  0% {
    transform: translateX(20%) translateY(-20%) rotate(0deg);
  }
  100% {
    transform: translateX(-20%) translateY(20%) rotate(360deg);
  }
}

/* Hide old background container */
.main-background {
  display: none;
}

/* Login card (glassmorphism) */
#loginPage {
  background: rgba(16, 18, 27, 0.4);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  padding: 2.5rem;
  color: white;
}
#loginPage h2 {
  color: #f0f0f0;
  font-size: 1.75rem;
  text-shadow: 0 0 10px rgba(252, 255, 104, 0.5),
    0 0 20px rgba(240, 255, 104, 0.3);
}

/* Futuristic inputs/buttons */
#loginForm input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  width: 100%;
  transition: all 0.3s ease;
}
#loginForm input:focus {
  outline: none;
  border-color: rgba(104, 225, 255, 0.8);
  box-shadow: 0 0 15px rgba(169, 104, 255, 0.5);
}
#loginForm label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #9ad9d6;
}
#loginForm button[type="submit"] {
  width: 100%;
  color: white;
  background: linear-gradient(90deg, #2b80e2, #001882);
  font-weight: 600;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  padding: 0.75rem 1.25rem;
  text-align: center;
  border: none;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(43, 159, 226, 0.4);
}
#loginForm button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(43, 168, 226, 0.7);
}
#showRegisterBtn {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #9ad5d9;
  margin-top: 0.5rem;
  transition: all 0.3s ease;
}
#showRegisterBtn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

/* A4 page styling for printable sections */
.a4-page-container {
  width: 100%;
  max-width: 8.5in;
  margin: 2rem auto;
}
.a4-page {
  background: white;
  color: black;
  display: block;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 0.5cm rgba(0, 0, 0, 0.5);
  width: 100%;
  min-height: 11in;
  padding: 2cm 1.5cm;
}

/* Form elements inside printable pages */
.form-input {
  background-color: transparent;
  border: none;
  border-bottom: 1px solid #9ca3af;
  padding: 2px 0;
  width: 90%;
  color: black;
}
.form-input:focus {
  outline: none;
  border-bottom: 2px solid #4338ca;
}
.form-textarea-line {
  background-color: transparent;
  border: none;
  border-bottom: 1px solid #9ca3af;
  padding: 2px;
  width: 100%;
  border-radius: 0;
  color: black;
  resize: none;
  text-align: left;
  overflow-y: hidden;
}
.form-textarea-line:focus {
  outline: none;
  border-bottom: 2px solid #0891b2;
}

/* Generic modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background-color: #1e293b;
  padding: 2rem;
  border-radius: 0.75rem;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  color: #e2e8f0;
  border: 1px solid #334155;
}

/* Notification toast */
#notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  color: white;
  z-index: 2000;
  transition: all 0.5s ease-in-out;
  opacity: 0;
  pointer-events: none;
}
#notification.show {
  opacity: 1;
  transform: translate(-50%, 10px);
}
#notification.success {
  background-color: #10b981;
}
#notification.error {
  background-color: #ef4444;
}

/* Editable area highlight */
.editable-area {
  padding: 5px;
  border-radius: 5px;
  transition: all 0.3s;
  border: 1px solid transparent;
}
.editable-area[contenteditable="true"] {
  outline: 2px solid #0891b2;
  background-color: #f0f9ff;
  border: 1px solid #d1d5db;
}

/* Spinner */
.loader {
  border: 4px solid #f3f3f3;
  border-radius: 50%;
  border-top: 4px solid #3498db;
  width: 40px;
  height: 40px;
  animation: spin 2s linear infinite;
  margin: 20px auto;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.kbc-textarea {
  resize: both;
  overflow-y: hidden;
  min-height: 2.5em;
}

/* AI button look */
.ai-feature {
  background-color: #0891b2;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 0.3s;
  text-decoration: none;
}
.ai-feature:hover {
  background-color: #0e7490;
}
.premium-feature-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.group-heading {
  background-color: #eef2ff;
  color: #312e81;
  padding: 0.5rem 1rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 700;
  border-left: 5px solid #4338ca;
}

#lessonPlanPage:not(.hidden) {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Prota Promes specific */
#protaPromesPage {
  font-family: "Inter", sans-serif;
  background-color: #f3f4f6;
  color: #111827;
}
#protaPromesPage .page-container {
  margin: 1rem auto;
  border: 1px #d1d5db solid;
  background: white;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}
#protaPromesPage .a4-page {
  width: 21cm;
  min-height: 29.7cm;
  padding: 2cm;
  box-shadow: none;
}
#protaPromesPage .a4-landscape-page {
  width: 29.7cm;
  min-height: 21cm;
  padding: 1.5cm;
  box-shadow: none;
}
@media (max-width: 1200px) {
  #protaPromesPage .a4-landscape-page {
    width: 100%;
    min-height: auto;
    height: auto;
    padding: 1.5rem;
  }
}
@media (max-width: 900px) {
  #protaPromesPage .a4-page {
    width: 100%;
    min-height: auto;
    height: auto;
    padding: 1.5rem;
  }
}
#protaPromesPage .table-prosem th,
#protaPromesPage .table-prosem td {
  border: 1px solid black;
  padding: 4px;
  text-align: center;
  font-size: 10px;
  vertical-align: middle;
}
#protaPromesPage .table-prosem .atp-bullet-cell {
  text-align: left !important;
  vertical-align: top !important;
  padding: 4px 8px !important;
}
#protaPromesPage .table-prosem td.align-top {
  vertical-align: top;
}
#protaPromesPage .table-prosem .print-checkbox-placeholder {
  display: none;
}
#protaPromesPage #identityModal,
#protaPromesPage #geminiModal,
#protaPromesPage #intervalModal {
  transition: opacity 0.3s ease-in-out;
}
#protaPromesPage .spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: #09f;
  animation: spin 1s ease infinite;
}
#protaPromesPage [contenteditable="true"]:empty:before {
  content: attr(placeholder);
  pointer-events: none;
  display: block;
  color: #a1a1aa;
}
#protaPromesPage .print-only {
  display: none;
}

/* ATP checklist visuals */
.atp-checklist-item {
  display: block;
  padding: 4px 0;
  border-bottom: 1px solid #e5e7eb;
  min-height: 24px;
  text-align: left;
  line-height: 1.4;
}
.atp-checklist-item:last-child {
  border-bottom: none;
}
.atp-checklist-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* KKTP ATP cell */
#kktpPage .kktp-atp-cell {
  text-align: left !important;
  vertical-align: middle !important;
  padding: 10px 12px !important;
  line-height: 1.6;
  min-height: 40px;
  background-color: #fafafa;
}

/* Print rules */
@media print {
  .no-print,
  #printProtaBtn {
    display: none !important;
  }
  body,
  html,
  #mainAppContainer,
  #mainAppContainer > .flex,
  #mainContentArea {
    height: auto !important;
    overflow: visible !important;
    background: white !important;
    color: black !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }
  #mainContentArea > div {
    display: none !important;
  }
  #mainContentArea > .active-print {
    display: block !important;
    padding: 0 !important;
  }
  #modulAjarPage.active-print > *:not(#print-content),
  #lessonPlanPage.active-print > *:not(#print-content-lp) {
    display: none !important;
  }
  #modulAjarPage.active-print #print-content,
  #modulAjarPage.active-print .a4-page-container,
  #lessonPlanPage.active-print #print-content-lp,
  #lessonPlanPage.active-print .a4-page-container {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
  }
  #modulAjarPage.active-print .a4-page,
  #lessonPlanPage.active-print .a4-page {
    margin: 0 !important;
    padding: 1.5cm !important;
    box-shadow: none !important;
    border: none !important;
    min-height: auto !important;
  }
  #protaPromesPage.active-print aside,
  #protaPromesPage.active-print .print-hidden,
  #protaPromesPage.active-print .table-prosem input[type="checkbox"] {
    display: none !important;
  }
  #protaPromesPage.active-print .table-prosem .print-checkbox-placeholder {
    display: block !important;
    text-align: center;
    font-weight: bold;
  }
  #protaPromesPage.active-print .page-container {
    width: 100% !important;
    height: auto !important;
    min-height: initial !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
  #protaPromesPage.active-print textarea,
  #protaPromesPage.active-print div[contenteditable] {
    display: none !important;
  }
  #protaPromesPage.active-print .print-only {
    display: block !important;
    white-space: pre-wrap;
    word-wrap: break-word;
  }
  h1,
  h2,
  h3,
  h4 {
    page-break-after: avoid;
  }
  table {
    page-break-inside: auto;
  }
  thead {
    display: table-header-group;
  }
  section[id^="tanda-tangan"] {
    page-break-inside: avoid;
  }
}
#kktpPage h3.print-only {
  text-align: left;
}

/* ATP UI add-on (bottom of file in original) */
.atp-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.atp-line {
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid #ddd;
  padding: 2px 0;
}
.atp-line input[type="checkbox"] {
  margin-right: 6px;
  margin-top: 3px;
}
