/* Smart School OS Styles */
body {
  font-family: Arial, sans-serif;
  background: #f4f6f8;
  margin: 0;
  text-align: center;
}

header {
  background: #123c5a;
  color: white;
  padding: 20px;
}

button {
  padding: 10px 16px;
  margin: 6px;
  border: none;
  border-radius: 6px;
  background: #123c5a;
  color: white;
  cursor: pointer;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 20px;
}

.day-name {
  background: #dce6ef;
  font-weight: bold;
  padding: 10px;
  border-radius: 6px;
}

.day {
 background: white;
min-height: 115px;
border: 1px solid #dbe4ea;
border-radius: 12px;
padding: 10px;
cursor: pointer;
  transition: all 0.25s ease;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
overflow: hidden;
  }
  .day:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);



}

.empty {
  background: transparent;
  border: none;
}

.event-box {
  margin-top: 6px;
  padding: 5px;
  border-radius: 5px;
  font-size: 12px;
  color: white;
}

.lesson { background: #1976d2; }
.exam { background: #f57c00; }
.homework { background: #6a1b9a; }
.holiday { background: #2e7d32; }
.redday { background: #c62828; }
.school { background: #455a64; }
.note { background: #00897b; }

.week-title {
  background: #e8eef5;
  margin: 20px;
  padding: 10px;
  border-radius: 8px;
}

#popup {
  display: none;
  position: fixed;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 2px solid #333;
  border-radius: 10px;
  padding: 20px;
  width: 380px;
  box-shadow: 0 0 25px #777;
  z-index: 10;
}

input, textarea, select {
    width: 95%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px;
    margin: 6px auto;
    display: block;
}

select {
    direction: ltr;
}

html[dir="rtl"] select {
    text-align: right;
}

.searchable-combobox {
    position: relative;
    width: 95%;
    max-width: 100%;
    margin: 6px auto;
    box-sizing: border-box;
}

.searchable-combobox-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
    border: 0;
}

.searchable-combobox-trigger {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    margin: 0;
    display: block;
    text-align: left;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

.searchable-combobox-value {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchable-combobox-panel {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 280px;
    display: flex;
    flex-direction: column;
}

.searchable-combobox-panel[hidden] {
    display: none !important;
}

.searchable-combobox-search-wrap {
    padding: 8px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.searchable-combobox-search {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    margin: 0;
    display: block;
}

.searchable-combobox-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1 1 auto;
}

.searchable-combobox-option {
    padding: 8px 12px;
    cursor: pointer;
}

.searchable-combobox-option.hidden {
    display: none;
}

.searchable-combobox-option.active,
.searchable-combobox-option:hover {
    background: #e0f7fa;
}

.searchable-combobox-placeholder {
    color: #666;
    border-bottom: 1px solid #eee;
}

html[dir="rtl"] .searchable-combobox-trigger {
    text-align: right;
}

textarea {
  height: 90px;
}

.today {
  border: 3px solid #00bcd4 !important;
  background: #e0f7fa !important;
}

.today-pulse {
  animation: pulseToday 1s infinite;
}

@keyframes pulseToday {
  0% { box-shadow: 0 0 0 0 rgba(0, 188, 212, 0.8); }
  70% { box-shadow: 0 0 0 12px rgba(0, 188, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 188, 212, 0); }
}

#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f6f8;
}

.login-card {
  background: white;
  width: 360px;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.18);
  text-align: center;
}

.login-card h2 {
  margin-top: 0;
  color: #123c5a;
}

#errorBox {
  color: #c62828;
  font-size: 14px;
  min-height: 20px;
  margin-top: 8px;
}

#appContent {
  display: none;
}

#userBar {
  background: #e8eef5;
  padding: 8px 12px;
  text-align: right;
  font-size: 14px;
}

#logoutBtn {
  padding: 6px 10px;
  margin-left: 10px;
}


#settingsPopup {
  display: none;
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 2px solid #333;
  border-radius: 10px;
  padding: 20px;
  width: 420px;
  max-width: 95vw;
  box-shadow: 0 0 25px #777;
  z-index: 20;
}

#curriculumPacksSection {
  margin-top: 16px;
  border-top: 1px solid #ccc;
  padding-top: 12px;
}

#curriculumPacksSection h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

#curriculumPacksDescription {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: #555;
}

.curriculum-pack-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.curriculum-pack-info {
  flex: 1;
  min-width: 0;
}

.curriculum-pack-desc {
  font-size: 0.85rem;
  color: #666;
  margin-top: 2px;
}

.curriculum-pack-status {
  font-size: 0.85rem;
  color: #444;
  margin-top: 4px;
}

.curriculum-pack-apply-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  background: #00897b;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.curriculum-pack-apply-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.curriculum-pack-message {
  margin: 8px 0 0;
  font-size: 0.9rem;
}

.curriculum-pack-message.success {
  color: #2e7d32;
}

.curriculum-pack-message.error {
  color: #c62828;
}

.curriculum-pack-message.applying {
  color: #555;
}

.settings-btn {
  background: #00897b;
}


.owner-badge {
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.9;
}

.owner-fixed {
  font-weight: bold;
}

.settings-btn {
    display: none;
}

button {
    transition: transform 0.1s ease, opacity 0.1s ease;
}

button:hover {
    opacity: 0.9;
}

button:active {
    transform: scale(0.96);
    opacity: 0.75;
}

#timetableSection {
    max-width: 720px;
    margin: 0 auto 40px;
    padding: 0 16px;
    text-align: left;
}

.timetable-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 16px 0;
}

.timetable-controls label {
    font-weight: bold;
    margin: 0;
}

.timetable-controls select,
.timetable-controls input[type="date"] {
    width: auto;
    min-width: 160px;
    margin: 0;
    display: inline-block;
}

.timetable-controls button {
    margin: 0;
}

.timetable-lesson-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}

.timetable-lesson-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    margin: 0;
    border-radius: 10px;
    border: 2px solid transparent;
    background: #fff;
    color: #123c5a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.timetable-lesson-cell:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.timetable-lesson-pending {
    border-color: #ffb74d;
    background: #fff8e1;
}

.timetable-lesson-completed {
    border-color: #66bb6a;
    background: #e8f5e9;
}

.timetable-lesson-period {
    font-weight: bold;
    font-size: 15px;
}

.timetable-lesson-subject {
    font-size: 14px;
    margin-top: 4px;
}

.timetable-lesson-class {
    font-size: 13px;
    color: #455a64;
    margin-top: 2px;
}

.timetable-lesson-time {
    font-size: 12px;
    color: #607d8b;
    margin-top: 4px;
}

.timetable-lesson-status {
    margin-top: 8px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.timetable-lesson-pending .timetable-lesson-status {
    color: #ef6c00;
}

.timetable-lesson-completed .timetable-lesson-status {
    color: #2e7d32;
}

.timetable-empty-state {
    color: #607d8b;
    font-style: italic;
    margin: 12px 0;
}

.timetable-lesson-stub {
    margin: 12px 0;
    padding: 10px 12px;
    background: #e3f2fd;
    border-radius: 8px;
    color: #1565c0;
    font-size: 14px;
}

.timetable-attendance-panel {
    margin: 20px 0;
    padding: 16px;
    border-radius: 10px;
    border: 2px solid #90caf9;
    background: #f5f9ff;
}

.attendance-panel-meta {
    margin: 8px 0 12px;
    color: #455a64;
    font-size: 14px;
}

.attendance-correction-hint {
    margin: 0 0 12px;
    padding: 8px 10px;
    background: #fff3e0;
    border-radius: 6px;
    color: #e65100;
    font-size: 13px;
}

.attendance-roster-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

.attendance-roster-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.attendance-student-name {
    flex: 1 1 200px;
    font-size: 14px;
}

.attendance-status-select {
    min-width: 180px;
    margin: 0;
}

.attendance-empty-roster {
    color: #607d8b;
    font-style: italic;
    margin: 8px 0;
}

.attendance-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.attendance-panel-actions button {
    margin: 0;
}

html[dir="rtl"] .attendance-roster-row {
    text-align: right;
}

html[dir="rtl"] .attendance-status-select {
    direction: rtl;
}

.timetable-lesson-form {
    display: grid;
    gap: 4px 12px;
    margin-top: 12px;
}

.timetable-lesson-form label {
    font-weight: bold;
    margin-top: 8px;
}

.timetable-lesson-form select,
.timetable-lesson-form input {
    width: 100%;
    margin: 0 0 8px;
}

html[dir="rtl"] #timetableSection,
html[dir="rtl"] .timetable-lesson-cell {
    text-align: right;
    align-items: flex-end;
}
