@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght,CRSV@100..900,0&display=swap');

/* ===========================
   RESET & BASE
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  /* font-family: "Montserrat", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; */
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #312F2F;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #333;
  /* --bs-body-bg: #d6d6d6; */
}

main {
  flex: 1;
  padding: 30px 15px;
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #312F2F;
    --bs-btn-border-color: #312F2F;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #413e3e;
    --bs-btn-hover-border-color: #413e3e;
    --bs-btn-focus-shadow-rgb: 49, 132, 253;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #413e3e;
    --bs-btn-active-border-color: #0a53be;
    --bs-btn-active-shadow: inset 0 0px 0px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #312F2F;
    --bs-btn-disabled-border-color: #312F2F;
}

/* ===========================
   HOME PAGE
   =========================== */
body.home-page {
  align-items: center;
}

.lang-switcher-fixed {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
}

.home-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.home-card {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 24px;
  /* box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18); */
  /* padding: 48px 40px 40px; */
  width: 100%;
  max-width: 480px;
  text-align: center;
  overflow: visible;
  position: relative;
}

.home-logo {
  font-size: 64px;
  margin-bottom: 12px;
  animation: bounce 2.4s infinite;
}

.home-title {
  font-size: 26px;
  font-weight: 800;
  /* background: linear-gradient(135deg, #312F2F 0%, #764ba2 100%); */
  -webkit-background-clip: text;
  /* -webkit-text-fill-color: transparent; */
  background-clip: text;
  margin-bottom: 8px;
}

.home-subtitle {
  font-size: 14px;
  color: #999;
  margin-bottom: 28px;
}

.home-search {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===========================
   LANGUAGE DROPDOWN
   =========================== */
.lang-switcher {
  position: relative;
  display: inline-block;
}

.lang-dropdown {
  position: relative;
}

.lang-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: white;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.lang-trigger:hover {
  border-color: #312F2F;
  color: #312F2F;
}

.lang-arrow {
  font-size: 10px;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.lang-trigger[aria-expanded="true"] .lang-arrow {
  transform: rotate(180deg);
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: white;
  border: 1.5px solid #e8e8e8;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13);
  min-width: 140px;
  overflow: hidden;
  z-index: 1000;
}

.lang-menu.open {
  display: block;
  animation: dropIn 0.15s ease-out;
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lang-option {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lang-option:hover {
  background: #efefef;
  color: #312F2F;
}

.lang-option.active {
  color: #312F2F;
  font-weight: 700;
  background: #e9e9e9;
}

/* ===========================
   HEADER (schedule page)
   =========================== */
.header {
  background: #ffffff;
  /* backdrop-filter: blur(10px); */
  /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); */
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-image{
  width: 100px;
  margin-bottom: 16px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 15px;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.header-right {
  flex-shrink: 0;
}

.back-link {
  font-size: 12px;
  color: #999;
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover {
  color: #312F2F;
}

.header-title {
  font-size: 22px;
  font-weight: 700;
  color: #312F2F;
  -webkit-background-clip: text;
  /* -webkit-text-fill-color: transparent; */
  background-clip: text;
  margin: 0;
  white-space: nowrap;
}

/* ===========================
   SEARCH INPUT / BUTTON
   =========================== */
.search-input {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  transition: all 0.3s ease;
  width: 100%;
}

.search-input:focus {
  border-color: #312F2F;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

.search-input.is-invalid {
  border-color: #dc3545;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

.btn-load {
  /* background: linear-gradient(135deg, #312F2F 0%, #764ba2 100%); */
  border: none;
  border-radius: 12px;
  padding: 12px 28px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  white-space: nowrap;
  /* box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); */
  color: white;
  width: 280px;
}

/* .btn-load:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
  color: white;
} */

/* .btn-load:active {
  transform: translateY(0);
} */

/* ===========================
   MAIN CONTENT
   =========================== */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
}

/* Spinner */
.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  background: white;
  border-radius: 20px;
  /* box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1); */
}

.spinner-container .spinner-border {
  width: 56px;
  height: 56px;
}

.spinner-container p {
  font-size: 16px;
  color: #312F2F;
  font-weight: 600;
  margin-top: 14px;
}

/* Error */
.alert {
  border-radius: 14px;
  border: none;
  /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); */
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px;
}

.error-icon {
  font-size: 26px;
  line-height: 1;
}

/* ===========================
   TABS
   =========================== */
.tabs-container {
  background: white;
  border-radius: 20px;
  /* box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1); */
  overflow: hidden;
  margin-bottom: 20px;
}

.tabs-header {
  display: flex;
  gap: 6px;
  padding: 12px;
  /* background: #f8f9fa; */
  /* border-bottom: 2px solid #eee; */
  overflow-x: auto;
  scroll-behavior: smooth;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.tabs-header::-webkit-scrollbar {
  height: 0px;
}

/* .tabs-header::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.tabs-header::-webkit-scrollbar-thumb {
  background: #312F2F;
  border-radius: 3px;
} */

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 14px;
  background: white;
  /* border: 2px solid #e0e0e0; */
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 68px;
}

.tab-btn:hover:not(.past) {
  border-color: #312F2F;
  background: #00000012;
}

.tab-btn.active {
  background: #00000012;
  border-color: transparent;
  color: white;
  /* box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35); */
}

/* Today ring */
.tab-btn.today:not(.active) {
  border-color: #312F2F52;
}

/* Past days dimmed */
.tab-btn.past {
  opacity: 0.38;
  background: #f4f4f4;
  border-color: #ddd;
  cursor: default;
}
.tab-btn.past:hover {
  opacity: 0.5;
}

.tab-day {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.tab-date {
  font-size: 10px;
  opacity: 0.7;
  font-weight: 500;
}

.tab-btn.active .tab-date {
  opacity: 0.9;
}

/* ===========================
   SCHEDULE GRID
   =========================== */
.schedule-content {
  /* padding-top: 20px !important; */
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px;
  min-height: 360px;
}

/* Break block */
.break-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 2px;
  color: #333333;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 0;
  height: 40px;
  border-left: 2px dashed #312F2F7b;
  padding: 16px;
}

/* .break-block::before,
.break-block::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #f0f0f0;
} */

/* Event card */
.event-card {
  background: white;
  /* border-radius: 14px; */
  padding: 16px;
  /* box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07); */
  transition: all 0.25s ease;
  border-left: 2px solid #312F2F;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 12px;
  margin-bottom: 12px;
}

/* .event-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.11);
} */

.event-time {
  font-size: 12px;
  color: #575757;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.event-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.event-subject {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  line-height: 1.4;
  flex: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.event-room {
  font-size: 13px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 5px;
}

.event-teacher {
  font-size: 13px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 5px;
}

.event-online {
  display: flex;
  align-items: center;
  margin-top: 2px;
}

.online-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  /* background: linear-gradient(135deg, #312F2F 0%, #764ba2 100%); */
  background: #6359c1;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.25s ease;
}

.online-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
  color: white;
  text-decoration: none;
}

/* Empty day */
.event-card.empty-day {
  background: #fafafa;
  border-left: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  color: #ccc;
  font-style: italic;
  box-shadow: none;
  margin-bottom: 0;
}

/* ===========================
   BADGES
   =========================== */
.info-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.badge-green {
  background: #e8f5e9;
  color: #388e3c;
}
.badge-red {
  background: #ffe5e5;
  color: #d32f2f;
}
.badge-purple {
  background: #f0e6fc;
  color: #764ba2;
}

/* Hide legacy badges */
.status-badge,
.event-top-row,
.class-type-badge {
  display: none;
}

/* ===========================
   LAST UPDATED
   =========================== */
.last-updated {
  text-align: center;
  color: #ccc;
  font-size: 11px;
  font-weight: 500;
  padding: 8px 20px 14px;
  border-top: 1px solid #f4f4f4;
  letter-spacing: 0.2px;
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  /* background: rgba(0, 0, 0, 0.1); */
  color: #312F2F;
  text-align: center;
  padding: 16px 20px;
  font-size: 13px;
  margin-top: auto;
}

/* ===========================
   ANIMATIONS
   =========================== */
.fade-enter {
  animation: fadeIn 0.28s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

.d-none {
  display: none !important;
}

/* ===========================
   RESPONSIVE — TABLET
   =========================== */
@media (max-width: 1024px) {
  .header-title {
    font-size: 19px;
  }
}

/* ===========================
   RESPONSIVE — MOBILE
   =========================== */
@media (max-width: 768px) {
  main {
    padding: 14px 10px;
  }
  .header {
    padding: 12px 0;
  }
  .header-title {
    font-size: 17px;
  }
  /* .home-card {
    padding: 36px 24px 28px;
  } */
  .home-title {
    font-size: 22px;
    color: #312F2F;
  }
  .tabs-header {
    gap: 5px;
    padding: 8px;
  }
  .tab-btn {
    min-width: 68px;
    padding: 8px 10px;
  }
  /* .tab-day {
    font-size: 11px;
  } */
  /* .tab-date {
    font-size: 9px;
  } */
  .schedule-content {
    padding: 14px;
  }
  .event-card {
    padding: 12px;
    gap: 7px;
    margin-bottom: 10px;
  }
  .break-block{
    padding: 12px;
  }
  .event-subject {
    font-size: 14px;
  }
  .event-time {
    font-size: 11px;
  }
}

/* ===========================
   RESPONSIVE — SMALL MOBILE
   =========================== */
@media (max-width: 480px) {
  /* .home-card {
    padding: 28px 16px 22px;
  } */
  .home-logo {
    font-size: 48px;
  }
  .home-title {
    font-size: 19px;
  }
  .lang-trigger {
    font-size: 12px;
    padding: 6px 10px;
  }
  .tab-btn {
    min-width: 62px;
    padding: 6px 7px;
  }
  /* .tab-day {
    font-size: 10px;
  } */
  /* .tab-date {
    font-size: 8px;
  } */
  .schedule-content {
    padding: 10px;
  }
  .event-card {
    padding: 10px;
    gap: 6px;
    margin-bottom: 8px;
  }
  .break-block{
    padding: 10px;
  }
  .event-subject {
    font-size: 13px;
  }
  .event-room,
  .event-teacher {
    font-size: 12px;
  }
  .online-link {
    font-size: 11px;
    padding: 6px 11px;
  }
  .footer {
    font-size: 11px;
    padding: 12px;
  }
}

/* ===========================
   GROUP BADGES & MULTI-GROUP
   =========================== */
.header-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.group-badges {
  padding-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.group-badge {
  display: inline-block;
  padding: 2px 9px;
  background: linear-gradient(135deg, #312F2F22 0%, #764ba222 100%);
  border: 1.5px solid #312F2F55;
  color: #312F2F;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.partial-warning {
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #795548;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  margin-bottom: 12px;
}

/* ===========================
   MULTI-GROUP INPUT ROWS
   =========================== */
.group-input-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.group-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-input-row .search-input {
  flex: 1;
  margin: 0;
}

.input-row-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid #e0e0e0;
  background: white;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #666;
  padding: 0;
  margin: 5px 0;
}

.add-btn {
  border-color: #312F2F;
  color: #312F2F;
}

.add-btn:hover {
  background: #312F2F;
  color: white;
  /* box-shadow: 0 3px 10px rgba(102, 126, 234, 0.35); */
  transform: scale(1.05);
}

.remove-btn:hover {
  border-color: #e57373;
  color: #e57373;
  background: #fff5f5;
}

.clear-btn {
  position: absolute;
  right: 8px;
  top: 45%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #aaa;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
  margin: 0 !important;
}

.clear-btn:hover {
  color: #e57373;
  transform: translateY(-50%) scale(1.15);
}

/* ===========================
   TABS & GROUP SEARCH
   =========================== */
.tabs-container {
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  /* background: #f8f9fa; */
}

.tabs-header {
  display: flex;
  /* border-bottom: 2px solid #e0e0e0; */
  gap: 8px;
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  background: none;
  /* border: none; */
  color: #999;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  white-space: nowrap;
  border: solid 1px #e0e0e0;
}

.tab-btn:hover {
  background: rgba(102, 126, 234, 0.05);
  color: #312F2F;
  border: none;
}

.tab-btn.active {
  color: #312F2F;
  /* border-bottom: 3px solid #312F2F; */
  /* margin-bottom: -2px; */
  /* background: #312F2F; */
  border: none;
}

.tab-content {
  padding: 20px;
  display: none;
  animation: fadeIn 0.2s ease;
  overflow: visible;
  position: relative;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#groupSearchInput {
  width: 100%;
  margin-bottom: 12px;
}

/* .group-search-results {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: white;
} */

.search-result-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-result-item:hover {
  background: #f8f9fa;
  transform: translateX(4px);
}

.search-result-item:last-child {
  border-bottom: none;
}

.result-info {
  text-align: left;
  flex: 1;
}

.result-name {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-category {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

.result-id {
  font-size: 13px;
  font-weight: bold;
  color: #312F2F;
  flex-shrink: 0;
  margin-left: 12px;
  font-family: monospace;
}

.search-no-results {
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

/* ===========================
   SEARCH INPUT LIST (NEW TAB)
   =========================== */
.search-input-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: visible;
}

.search-input-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  position: relative;
  overflow: visible;
}

.search-input-wrapper {
  /* display: flex;
  align-items: center; */
  flex: 1;
  position: relative;
  overflow: visible;
}

.group-search-field {
  width: 100%;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px 40px 12px 16px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.group-search-field:focus {
  border-color: #312F2F;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

.group-search-field.selected {
  background: #f8f9fa;
  color: #333;
  cursor: default;
  border-color: #312F2F;
}

.group-search-results {
  /* position: absolute;
  top: 100%;
  left: 0;
  right: 0; */
  background: white;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 12px 12px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  width: 280px;
}

.search-result-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-result-item:hover {
  background: #f8f9fa;
  transform: translateX(2px);
}

.search-result-item:last-child {
  border-bottom: none;
}

.result-info {
  text-align: left;
  flex: 1;
}

.result-name {
  font-weight: 600;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-category {
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
}

.result-id {
  font-size: 12px;
  font-weight: bold;
  color: #312F2F;
  flex-shrink: 0;
  margin-left: 8px;
  font-family: monospace;
}

.search-no-results {
  padding: 14px 16px;
  text-align: center;
  color: #aaa;
  font-size: 13px;
}
