/* Edufreely Time Table — scoped under .eftt to avoid theme conflicts */
.eftt, .eftt * { box-sizing: border-box; }
.eftt { font-family: 'Noto Sans Devanagari', Arial, sans-serif; padding: 15px; background: var(--eftt-bg, #f0f2f5); color: var(--eftt-fg, #222); border-radius: 10px; }
.eftt .eftt-container { max-width: 1500px; margin: auto; background: var(--eftt-card, #fff); padding: 25px; border-radius: 10px; box-shadow: 0 2px 15px rgba(0,0,0,0.1); }
.eftt h1 { color: var(--eftt-accent, #c62828); text-align: center; margin: 0 0 20px; font-size: 32px; }
.eftt h3 { margin-bottom: 10px; color: var(--eftt-fg, #222); }
.eftt .eftt-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 15px; margin: 15px 0; }
.eftt .eftt-fg { display: flex; flex-direction: column; }
.eftt label { font-weight: 600; margin-bottom: 5px; color: var(--eftt-fg, #333); font-size: 14px; }
.eftt input, .eftt select, .eftt textarea { padding: 10px; border: 2px solid var(--eftt-border, #ddd); border-radius: 6px; font-size: 14px; font-family: inherit; width:100%; background: var(--eftt-input-bg, #fff); color: var(--eftt-fg, #222); }
.eftt input:focus, .eftt select:focus, .eftt textarea:focus { outline: none; border-color: var(--eftt-accent, #c62828); }
.eftt textarea { resize: vertical; }
.eftt .eftt-btn { background: var(--eftt-accent, #c62828); color: #fff; padding: 12px 22px; border: none; border-radius: 6px; cursor: pointer; font-size: 15px; font-weight: 600; margin: 5px; }
.eftt .eftt-btn:hover { opacity: 0.9; }
.eftt .eftt-btn-blue { background: #1976d2; }
.eftt .eftt-btn-green { background: #388e3c; }
.eftt .eftt-btn-teal { background: #16a085; }
.eftt .eftt-btn-orange { background: #f57c00; }
.eftt .eftt-btn-gray { background: #616161; }
.eftt .eftt-btn-group { text-align: center; margin: 20px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.eftt table { width: 100%; border-collapse: collapse; margin-top: 15px; font-size: 12px; color: var(--eftt-fg, #222); }
.eftt th, .eftt td { border: 1px solid var(--eftt-table-border, #000); padding: 6px 4px; text-align: center; }
.eftt th { background: var(--eftt-accent, #c62828); color: #fff; }
.eftt .eftt-section-box { background: var(--eftt-section-1, #e8f5e9); padding: 15px; border-radius: 6px; margin: 12px 0; border: 2px solid #4caf50; }
.eftt .eftt-period-times { background: var(--eftt-section-2, #e3f2fd); padding: 15px; border-radius: 6px; margin: 12px 0; }
.eftt .eftt-teacher-section { background: var(--eftt-section-3, #f3e5f5); padding: 15px; border-radius: 6px; margin: 12px 0; }
.eftt .eftt-teacher-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-top: 10px; }
.eftt .eftt-period-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; }
.eftt .eftt-teacher-box { background: var(--eftt-card, #fff); padding: 12px; border-radius: 6px; border: 1px solid #ce93d8; position: relative; }
.eftt .eftt-remove-btn { position: absolute; top: 5px; right: 5px; background: #f44336; color: #fff; border: none; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; font-weight:bold; }
.eftt .eftt-subject-checks { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.eftt .eftt-subject-checks label { font-weight:400; font-size:12px; background: var(--eftt-chip, #f3e5f5); color: var(--eftt-fg, #222); padding:3px 8px; border-radius:12px; cursor:pointer; }
.eftt .eftt-school-header { text-align:center; margin-bottom:15px; }
.eftt .eftt-school-header h2 { color: var(--eftt-accent, #c62828); font-size:24px; margin:0; }
.eftt .eftt-school-header p { font-size:14px; margin-top:4px; }
.eftt .eftt-signature-box { display:flex; justify-content:space-around; margin-top:40px; padding:0 20px; }
.eftt .eftt-signature-box div { text-align:center; border-top:2px solid var(--eftt-fg, #333); padding-top:8px; min-width:140px; font-size:13px; }
.eftt .eftt-instructions-print { margin-top:20px; padding:12px; border:1px dashed #888; border-radius:6px; font-size:13px; white-space:pre-wrap; }
.eftt .eftt-school-header .eftt-sub-title { font-size:15px; margin:6px 0 2px; color: var(--eftt-fg,#222); }
.eftt .eftt-school-header .eftt-meta { font-size:13px; margin:2px 0; }
.eftt .eftt-tt-table td, .eftt .eftt-tt-table th { vertical-align: middle; padding:6px 4px; }
.eftt .eftt-tt-table .eftt-teach { display:block; font-size:11px; font-weight:500; color:#333; margin-top:2px; }
.eftt[data-theme="dark"] .eftt-tt-table .eftt-teach { color:#ddd; }
.eftt .eftt-tt-table tr.eftt-r-special td { background:#111; color:#fff; font-weight:600; }
.eftt .eftt-tt-table tr.eftt-r-special td:nth-child(n+3) { background:#111; color:#fff; }

/* Theme toggle */
.eftt .eftt-theme-toggle { display:flex; justify-content:flex-end; gap:6px; margin-bottom:8px; }
.eftt .eftt-theme-toggle button { padding:6px 12px; border:1px solid var(--eftt-border,#ddd); background: var(--eftt-card,#fff); color: var(--eftt-fg,#222); border-radius:20px; cursor:pointer; font-size:12px; }
.eftt .eftt-theme-toggle button.active { background: var(--eftt-accent,#c62828); color:#fff; border-color: var(--eftt-accent,#c62828); }

/* Light theme (default) */
.eftt[data-theme="light"] {
  --eftt-bg:#f0f2f5; --eftt-card:#fff; --eftt-fg:#222; --eftt-border:#ddd;
  --eftt-input-bg:#fff; --eftt-accent:#c62828; --eftt-table-border:#000;
  --eftt-section-1:#e8f5e9; --eftt-section-2:#e3f2fd; --eftt-section-3:#f3e5f5; --eftt-chip:#f3e5f5;
}
/* Dark theme */
.eftt[data-theme="dark"] {
  --eftt-bg:#1a1a1a; --eftt-card:#2a2a2a; --eftt-fg:#eee; --eftt-border:#444;
  --eftt-input-bg:#333; --eftt-accent:#ef5350; --eftt-table-border:#888;
  --eftt-section-1:#1f3a24; --eftt-section-2:#1e3a52; --eftt-section-3:#3a1f3f; --eftt-chip:#3a1f3f;
}

/* Print — only timetable visible */
@media print {
  body * { visibility: hidden !important; }
  .eftt, .eftt * { visibility: visible !important; }
  .eftt .eftt-no-print, .eftt .eftt-no-print * { display:none !important; }
  .eftt { position:absolute; left:0; top:0; width:100%; padding:0; background:#fff !important; color:#000 !important; }
  .eftt .eftt-container { box-shadow:none; padding:5px; max-width:100%; background:#fff !important; }
  .eftt th { background:#c62828 !important; color:#fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .eftt table { page-break-inside:avoid; color:#000 !important; }
  .eftt th, .eftt td { border:1px solid #000 !important; }
  @page { size: A4; margin: 10mm; }
}

@media (max-width: 768px) {
  .eftt .eftt-form-grid, .eftt .eftt-teacher-grid, .eftt .eftt-period-grid { grid-template-columns: 1fr; }
  .eftt table { font-size: 9px; }
  .eftt th, .eftt td { padding: 2px 1px; }
}
