/* ==========================================================================
   SWW Classroom Teacher Premium Design System (teacher_style.css)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&family=Sarabun:wght@400;500;600;700&display=swap');

:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --secondary-color: #0d9488;
  --secondary-hover: #0f766e;
  --bg-primary: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Sarabun', sans-serif;
  background: linear-gradient(135deg, #eef2ff 0%, #f0fdf4 50%, #fae8ff 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* macOS window container (for login page) */
.mac-window-container {
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1050px;
}

.mac-window-header {
  height: 45px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
}

.mac-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  display: inline-block;
}

.mac-dot.red { background-color: #ff5f56; }
.mac-dot.yellow { background-color: #ffbd2e; }
.mac-dot.green { background-color: #27c93f; }

/* Dashboard Container Layout */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Premium Light Sidebar (Notion/Linear Style) */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  padding: 0 1.5rem 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.sidebar-brand a {
  color: var(--text-main);
  font-weight: 700;
  text-decoration: none;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  font-family: 'Sarabun', sans-serif;
}

.sidebar-brand a i {
  color: var(--primary-color);
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.75rem;
}

.sidebar-menu .menu-header {
  padding: 0.75rem 0.75rem 0.25rem 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #475569;
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.sidebar-menu a:hover {
  color: var(--primary-color);
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.08) 0%, rgba(13, 148, 136, 0.05) 100%);
}

.sidebar-menu .active a {
  color: var(--primary-color);
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.1) 0%, rgba(224, 231, 255, 0.9) 100%);
  font-weight: 700;
}

.sidebar-menu a i {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border-radius: 0.8rem;
  background: #f8fafc;
  color: #475569;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
  transition: var(--transition-smooth);
}

.sidebar-menu a:hover i,
.sidebar-menu .active a i {
  color: var(--primary-color);
  background: #eef2ff;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.15);
  transform: translateY(-1px);
}

/* Main Content Area */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 992px) {
  .main-content {
    margin-left: 260px;
  }
}

/* Premium Top Navbar */
.top-navbar {
  height: 65px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 99;
}

.top-navbar .toggle-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
}

/* Cards & Layout Elements */
.glass-card, .card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  transition: var(--transition-smooth);
}

.glass-card:hover, .card:hover {
  box-shadow: var(--shadow-md) !important;
  transform: translateY(-2px);
}

/* Custom Buttons styling */
.btn-primary-custom {
  background: var(--primary-color);
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}

.btn-primary-custom:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  color: #fff;
}

.btn-secondary-custom {
  background: var(--secondary-color);
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}

.btn-secondary-custom:hover {
  background: var(--secondary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
  color: #fff;
}

/* Banner Styling */
.teacher-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.teacher-banner h1 {
  font-family: 'Sarabun', sans-serif;
  font-weight: 700;
}

/* Mobile Responsive Sidebar Rules */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(4px);
  z-index: 98;
  display: none;
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-260px);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .sidebar.show + .sidebar-overlay {
    display: block;
  }
  
  .main-content {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    margin-left: 0 !important;
  }
  
  .top-navbar .toggle-btn {
    display: block;
  }
  
  .top-navbar {
    padding: 0 1rem;
  }
}

@media (max-width: 575.98px) {
  .container-fluid {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  .card-body, .p-4 {
    padding: 1.25rem !important;
  }
}

/* Custom Premium Elements for Redesigned Content Pages */
.premium-hero-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border-left: 6px solid var(--primary-color);
  border-right: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.premium-hero-banner h1 {
  color: var(--text-main);
  font-family: 'Sarabun', sans-serif;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.premium-hero-banner p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 0;
}

/* Redesigned Subject Card with Modern Gradient Cover Header */
.subject-card-premium {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.subject-card-premium:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.subject-card-premium .card-cover {
  height: 65px;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

/* Card Themes (Colorful) */
.subject-card-premium.theme-color-1 {
  background: linear-gradient(to bottom, #f5f3ff 0%, #ffffff 100%);
  border-color: #c7d2fe;
}
.subject-card-premium.theme-color-1:hover {
  border-color: #818cf8;
}
.subject-card-premium.theme-color-1 .card-cover {
  background: linear-gradient(135deg, #818cf8 0%, #4f46e5 100%);
}

.subject-card-premium.theme-color-2 {
  background: linear-gradient(to bottom, #f0f9ff 0%, #ffffff 100%);
  border-color: #bae6fd;
}
.subject-card-premium.theme-color-2:hover {
  border-color: #38bdf8;
}
.subject-card-premium.theme-color-2 .card-cover {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
}

.subject-card-premium.theme-color-3 {
  background: linear-gradient(to bottom, #f0fdf4 0%, #ffffff 100%);
  border-color: #a7f3d0;
}
.subject-card-premium.theme-color-3:hover {
  border-color: #34d399;
}
.subject-card-premium.theme-color-3 .card-cover {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

.subject-card-premium .card-cover .subject-code {
  font-family: 'Sarabun', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.subject-card-premium .card-cover .classroom-badge {
  font-weight: 700;
  font-size: 0.75rem;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
}

.subject-card-premium .card-body-clean {
  padding: 1rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.subject-card-premium .card-title-clean {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
  line-height: 1.35;
}

.subject-card-premium .card-meta-clean {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Task Badge alerts */
.pending-badge-premium {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.pending-badge-premium.alert-danger {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.pending-badge-premium.alert-success {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* Beautiful Compact Action Grid Buttons (Horizontal style) */
.action-grid-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-smooth);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: #334155;
  height: 100%;
}

.action-grid-btn i {
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.action-grid-btn.lessons:hover {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.action-grid-btn.lessons i { color: #10b981; }

.action-grid-btn.assignments:hover {
  background-color: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}
.action-grid-btn.assignments i { color: #4f46e5; }

.action-grid-btn.quizzes:hover {
  background-color: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}
.action-grid-btn.quizzes i { color: #f43f5e; }

.action-grid-btn.gradebook:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}
.action-grid-btn.gradebook i { color: #475569; }

.subject-actions-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.subject-actions-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid #ddd6fe;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(13, 148, 136, 0.05) 100%);
  color: #4f46e5;
  border-radius: 1rem;
  padding: 0.8rem 0.9rem;
  font-weight: 700;
}

.subject-actions-bar-label {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.subject-actions-bar-label i {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.95rem;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  font-size: 1rem;
  flex: 0 0 auto;
}

.subject-actions-panel {
  overflow: visible;
  max-height: none;
  opacity: 1;
}

.subject-actions-panel .row {
  --bs-gutter-x: 0.65rem;
  --bs-gutter-y: 0.65rem;
}

.action-grid-btn {
  padding: 0.7rem 0.5rem;
  font-size: 0.76rem;
  border-radius: 0.9rem;
}

.action-grid-btn i {
  font-size: 1rem;
}

@media (max-width: 768px) {
  .subject-actions-wrap {
    gap: 0.4rem;
  }

  .subject-actions-bar {
    padding: 0.72rem 0.82rem;
  }

  .subject-actions-bar-label {
    gap: 0.6rem;
  }

  .subject-actions-bar-label i {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.85rem;
  }

  .action-grid-btn {
    padding: 0.65rem 0.45rem;
    font-size: 0.74rem;
  }
}
/* News Item Premium Card */
.news-item-premium {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.news-item-premium:hover {
  box-shadow: var(--shadow-md);
}

.news-title-area {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.news-badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

