/* ==========================================================================
   DepEd Daily Lesson Plan (DLP) Generator
   Official DepEd Curriculum Specialist & SHS Instructional Designer
   Compliant with DepEd Order No. 3 s. 2026
   ========================================================================== */

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

:root {
  /* Dark Navy & Emerald/Cyan Palette matching user screenshot */
  --bg-primary: #0a1128;
  --bg-secondary: #101c3d;
  --bg-card: rgba(16, 28, 61, 0.85);
  --bg-glass: rgba(10, 17, 40, 0.9);
  --border-color: rgba(255, 255, 255, 0.12);
  --border-highlight: #10b981;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-emerald: #10b981;
  --accent-cyan: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --accent-glow: rgba(16, 185, 129, 0.4);

  --paper-bg: #ffffff;
  --paper-text: #0f172a;
  --paper-border: #94a3b8;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-paper: 0 20px 30px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  --bg-primary: #f0f4f8;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.95);
  --border-color: #cbd5e1;
  --border-highlight: #10b981;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow-card: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Reset & Global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 3rem;
}

/* TOP HEADER & AVATAR PROFILE */
.app-header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem 1rem;
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 1rem;
}

.avatar-img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 25px var(--accent-glow);
}

.main-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.main-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* NAVBAR & TOP CONTROLS */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 2rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nlm-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: rgba(16, 28, 61, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nlm-badge.online {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.nlm-badge.offline {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-emerald {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-emerald:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--accent-emerald);
  color: #34d399;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}

/* REQUIRED INFORMATION CONTAINER (CARD MATCHING SCREENSHOT) */
.req-card {
  max-width: 900px;
  margin: 0 auto 2rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.req-header {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.req-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.req-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.req-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.req-item label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.req-item label span.num {
  color: var(--accent-cyan);
}

.form-control {
  padding: 0.7rem 0.95rem;
  background: rgba(10, 17, 40, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

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

.info-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* APP MAIN TWO-COLUMN CONTAINER */
.app-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  padding: 0 2rem;
  max-width: 1850px;
  margin: 0 auto;
}

@media (max-width: 1300px) {
  .app-container {
    grid-template-columns: 1fr;
  }
}

/* EDITOR PANEL */
.editor-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.tabs-header {
  display: flex;
  background: rgba(10, 17, 40, 0.8);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.tab-btn {
  padding: 0.9rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.08);
}

.tab-content {
  flex: 1;
  padding: 1.75rem;
  overflow-y: auto;
  display: none;
}

.tab-content.active {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.25rem;
}

.session-card {
  background: rgba(10, 17, 40, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.session-header {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* PREVIEW PANEL */
.preview-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.preview-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-color);
}

.paper-container {
  flex: 1;
  padding: 2rem;
  background: #1e293b;
  overflow: auto;
  display: flex;
  justify-content: center;
}

/* LANDSCAPE A4 DEPED PAPER LAYOUT */
.deped-paper {
  width: 297mm; /* A4 Landscape */
  max-width: 100%;
  box-sizing: border-box;
  min-height: 210mm;
  background: var(--paper-bg);
  color: var(--paper-text);
  padding: 15mm;
  box-shadow: var(--shadow-paper);
  font-family: 'Calibri', 'Arial', sans-serif;
  font-size: 9pt;
  line-height: 1.2;
}

.deped-header-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  margin-bottom: 6px;
}

.deped-header-table td {
  border: none !important;
  padding: 1px !important;
}

.deped-title {
  font-size: 13pt;
  font-weight: bold;
  text-transform: uppercase;
}

.deped-sub {
  font-size: 8.5pt;
}

.deped-divider {
  border-bottom: 2px solid #000;
  margin-bottom: 10px;
}

.deped-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  table-layout: fixed;
}

.deped-table th, .deped-table td {
  border: 1px solid #000;
  padding: 4px 5px;
  vertical-align: top;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.deped-table th {
  background-color: #f2f2f2;
  font-weight: bold;
}

.deped-sec-header {
  background-color: #d9e1f2;
  font-weight: bold;
  font-size: 10pt;
}

.deped-meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  table-layout: fixed;
}

.deped-meta-table td {
  border: 1px solid #000;
  padding: 4px 5px;
  vertical-align: top;
  word-wrap: break-word;
}

.deped-meta-label {
  font-weight: bold;
  background-color: #f9f9f9;
}

.deped-meta-value {
  background-color: #ffffff;
}

.deped-label-cell {
  background-color: #f9f9f9;
  font-weight: bold;
}

.signature-row {
  margin-top: 25px;
  display: flex;
  justify-content: space-between;
  font-size: 9.5pt;
}

.sig-block {
  width: 45%;
  text-align: center;
}

.sig-line {
  margin-top: 35px;
  font-weight: bold;
  text-decoration: underline;
  text-transform: uppercase;
}

/* MODALS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 90%;
  max-width: 680px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  max-height: 85vh;
  overflow-y: auto;
}

/* PRINT STYLES - A4 LANDSCAPE */
@media print {
  @page {
    size: A4 landscape;
    margin: 0.5in;
  }
  body * {
    visibility: hidden;
  }
  .preview-panel, .preview-panel * {
    visibility: visible;
  }
  .preview-panel {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: none;
    box-shadow: none;
  }
  .preview-toolbar {
    display: none !important;
  }
  .paper-container {
    padding: 0;
    background: transparent;
  }
  .deped-paper {
    box-shadow: none;
    padding: 0;
    width: 100%;
  }
}


.deped-label-subtext {
  font-weight: normal;
  font-style: italic;
  font-size: 7.5pt;
  color: #555;
  display: block;
  margin-top: 4px;
  line-height: 1.35;
}

.deped-label-subtext ul {
  margin: 4px 0 0 10px;
  padding: 0;
  list-style-type: disc;
}

.deped-label-subtext li {
  margin-bottom: 2px;
}

/* REDESIGNED DEPED METADATA TABLE & DASHED BORDER STYLES */
.deped-meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  border: 1.5px solid #000;
}

.deped-meta-table td {
  border-bottom: 1px solid #000;
  padding: 6px 10px;
  vertical-align: top;
  word-wrap: break-word;
}

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

.deped-meta-label {
  width: 2in !important;
  font-weight: bold;
  font-style: italic;
  border-right: 1px solid #000 !important;
  background-color: #ffffff;
  font-size: 9.5pt;
}

.deped-meta-value {
  background-color: #ffffff;
  font-size: 9.5pt;
}

.deped-label-cell {
  background-color: #ffffff !important;
  font-weight: bold;
  font-style: italic;
  width: 2in !important;
  border-right: 1px solid #000 !important;
}

.deped-paper.pdf-export-mode {
  width: 271.6mm !important;
  min-height: auto !important;
  padding: 0 !important;
  box-shadow: none !important;
}
