/* ===== Reset & Base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: url("../assets/home/bg.jpg") no-repeat center center fixed;
  background-size: cover;
  color: #1f2937;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: #0d6efd; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Global Frame ===== */
.main-frame {
  max-width: 1100px;
  width: 92%;
  margin: 40px auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(0,0,0,.15);
  flex: 1;
}

/* ===== Layout Helpers ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  padding: 20px;
  margin-bottom: 20px;
}
.flex { display: flex; align-items: center; justify-content: space-between; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
  border: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: #0d6efd; color: #fff; }
.btn-primary:hover { background: #0b5ed7; }
.btn-warning { background: #fdd835; color: #333; }
.btn-warning:hover { background: #fbc02d; }
.btn-sm { padding: 6px 12px; font-size: 14px; }

/* ===== Header & Footer ===== */
header.site-header {
  background: #0d6efd; color: #fff; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
header .logo { font-size: 20px; font-weight: bold; }
header .nav a { margin-left: 15px; color: #fff; font-weight: 500; }
header .nav a:hover { opacity: 0.9; }
footer.site-footer {
  background: #f1f5f9; padding: 20px; text-align: center;
  font-size: 14px; color: #555; margin-top: 40px;
}

/* ===== Utilities ===== */
.text-muted { color: #6b7280; }
.text-danger { color: #dc2626; }
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* ===== Auth Pages (Login/Register) ===== */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* form on left */
  min-height: 100vh;
  padding: 20px 40px;
}
.auth-box {
  background: #fff;
  padding: clamp(16px, 4vw, 28px);
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  width: 100%;
  max-width: min(420px, 92vw);
  margin: 0;
}
.auth-box h2 {
  text-align: center;
  margin-bottom: clamp(16px, 3.5vw, 24px);
  color: #f57f17;
  font-size: clamp(20px, 5.8vw, 26px);
  line-height: 1.2;
}
.form-group { margin-bottom: clamp(12px, 3vw, 18px); }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  color: #444;
  font-size: clamp(13px, 3.6vw, 15px);
}
.form-group input {
  display: block; width: 100%;
  padding: clamp(10px, 3.6vw, 14px);
  border-radius: 10px;
  border: 1px solid #cfd8dc;
  font-size: clamp(14px, 4.2vw, 16px);
  outline: none;
}
.form-group input:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13,110,253,.2);
}
.auth-footer {
  text-align: center;
  margin-top: 12px;
  font-size: clamp(12px, 3.8vw, 14px);
}
.auth-footer a { color: #0288d1; }
.auth-footer a:hover { text-decoration: underline; }
.error {
  color: red;
  text-align: center;
  margin-bottom: 12px;
  font-size: clamp(13px, 3.6vw, 14px);
}

@media (max-width: 480px) {
  .auth-page { padding: 14px; }
  .auth-box { border-radius: 16px; }
}



/* ===== Auth Pages (Login & Registration) ===== */
.auth-page {
  display: flex;
  justify-content: flex-start;   /* keep form on left */
  align-items: flex-start;
  min-height: 100vh;
  padding: 8vh 0 40px 60px;      /* top is flexible (viewport height) */
}

.auth-box {
  background: #fff;
  padding: clamp(16px, 4vw, 28px);
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  width: 100%;
  max-width: min(420px, 92vw);
  margin: 0;
}

.auth-box h2 {
  text-align: center;
  margin-bottom: clamp(16px, 3.5vw, 24px);
  color: #f57f17;
  font-size: clamp(20px, 5.8vw, 26px);
  line-height: 1.2;
}

.form-group { margin-bottom: clamp(12px, 3vw, 18px); }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  color: #444;
  font-size: clamp(13px, 3.6vw, 15px);
}
.form-group input, 
.form-group select,
.form-group textarea {
  display: block;
  width: 100%;
  padding: clamp(10px, 3.6vw, 14px);
  border-radius: 10px;
  border: 1px solid #cfd8dc;
  font-size: clamp(14px, 4.2vw, 16px);
  outline: none;
}
.form-group input:focus, 
.form-group select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13,110,253,.2);
}

.auth-footer {
  text-align: center;
  margin-top: 12px;
  font-size: clamp(12px, 3.8vw, 14px);
}
.auth-footer a { color: #0288d1; }
.auth-footer a:hover { text-decoration: underline; }

.error { color: red; text-align: center; margin: 10px 0; font-size: 14px; }
.success { color: green; text-align: center; margin: 10px 0; font-size: 14px; }

/* ===== Class Cards ===== */
.class-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.class-item {
  position: relative;
  height: 160px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  transition: transform 0.2s ease;
  background: #000; /* fallback color */
}
.class-item:hover { transform: scale(1.02); }

.class-bg {
  position: absolute;
  inset: 0;
  background: #ccc center/cover no-repeat;
  filter: brightness(0.85);
}

.class-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0));
  color: #fff;
  z-index: 2;
}

.class-info h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
}
.class-info p {
  margin: 2px 0;
  font-size: 13px;
  opacity: 0.95;
}

.badge {
  display: inline-block;
  background: rgba(255,255,255,.2);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.card-link {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 5; /* ensure it's above .class-bg and .class-info */
}


/* Student join form layout (no color overrides) */
.form-grid-join {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}
.form-grid-join .form-group { margin: 0; }
.form-grid-join .form-actions { margin: 0; }


/* style.css */
.profile-menu {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 6px 0;
  width: 200px;
  font-family: 'Segoe UI', sans-serif;
}

.profile-menu .menu-item,
.profile-menu .label {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.3;
  cursor: pointer;
}

.profile-menu .label {
  font-weight: bold;
  background: #fff4d4;
  color: #333;
  border-radius: 6px 6px 0 0;
}

.profile-menu a {
  color: #333;
  text-decoration: none;
  flex: 1;
}

.profile-menu a:hover {
  background: #f5f5f5;
}

.profile-menu .menu-divider {
  border-top: 1px solid #eee;
  margin: 4px 0;
}
