/* ==========================================================================
   PUGY ADMIN PANEL — PREMIUM LIGHT/CREAM DESIGN SYSTEM
   Theme: Warm Orange, Cream & Dark Chocolate
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font: 'Nunito', sans-serif;
  --fox: #E8620A;
  --fox-light: #FF7A1F;
  --fox-dim: rgba(232, 98, 10, 0.08);
  --primary: #E8620A;
  --primary-hover: #C4510A;
  --primary-light: #FFF3EB;
  
  --dark: #FFF8F2;      /* Page Background */
  --dark2: #FFFFFF;     /* Cards Background */
  --dark3: #FCF6F2;     /* Inner lists/background */
  --cream: #3D2010;     /* Primary text color / Header text */
  --cream2: #9C6B40;    /* Secondary text / muted text */
  --text: #3D2010;
  --text-muted: #9C6B40;
  
  --green: #2D9E6B;
  --red: #E84040;
  --border: rgba(232, 98, 10, 0.15); /* Soft cream border */
  --radius: 20px;
  --shadow: 0 8px 32px rgba(232, 98, 10, 0.08);
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden !important;
  position: fixed;
  font-family: var(--font);
  background: var(--dark);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* LOGIN */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 40% 30%, rgba(232, 98, 10, 0.08) 0%, transparent 60%), var(--dark);
  overflow-y: auto;
  padding: 20px;
}

.login-card {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 44px 40px;
  width: 380px;
  box-shadow: 0 20px 48px rgba(26, 18, 0, 0.08);
  text-align: center;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.login-card h1 {
  font-family: var(--font);
  font-size: 24px;
  font-weight: 800;
  color: var(--cream);
  margin-bottom: 6px;
}

.login-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.error-msg {
  color: var(--red);
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
}

/* PANEL LAYOUT */
.panel {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* SIDEBAR */
.sidebar {
  width: 250px;
  background: var(--dark2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, #FF8533 100%);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(232, 98, 10, 0.2);
}

.nav-icon {
  font-size: 18px;
}

.logout-btn {
  margin: 0 16px;
  background: transparent;
  border: 1px solid rgba(232, 64, 64, 0.2);
  color: var(--red);
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font);
  font-weight: 600;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(232, 64, 64, 0.05);
  border-color: rgba(232, 64, 64, 0.4);
}

/* CONTENT */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--dark2);
  flex-shrink: 0;
}

.topbar-title {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 800;
  color: var(--cream);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.lang-switcher {
  display: flex;
  gap: 4px;
}

.lang-btn {
  background: var(--dark3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  transition: all 0.2s;
}

.lang-btn:hover {
  border-color: var(--fox);
  color: var(--fox);
}

.lang-btn.active {
  background: var(--fox-dim);
  border-color: var(--fox);
  color: var(--fox);
}

.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--dark);
}

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(26, 18, 0, 0.08);
}

.stat-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.stat-value {
  font-family: var(--font);
  font-size: 32px;
  font-weight: 800;
  color: var(--fox);
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

/* QUICK ACTIONS */
.quick-actions {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.quick-actions h3 {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--cream);
}

.qa-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.qa-btn {
  background: var(--primary-light);
  border: 1px solid rgba(232, 98, 10, 0.15);
  color: var(--fox);
  padding: 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font);
  transition: all 0.2s;
}

.qa-btn:hover {
  background: var(--fox);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(232, 98, 10, 0.15);
}

/* RECENT LIST */
.recent-list {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.recent-list h3 {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--cream);
}

/* FORMS */
.form-card {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.form-card h3 {
  font-family: var(--font);
  font-size: 18px;
  font-weight: 800;
  color: var(--cream);
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
  background: var(--dark3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  transition: all 0.2s;
  outline: none;
  resize: vertical;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--fox);
  background: var(--dark2);
  box-shadow: 0 0 0 3px rgba(232, 98, 10, 0.08);
}

.form-group select option {
  background: var(--dark2);
}

/* BUTTONS */
.btn-primary {
  background: linear-gradient(135deg, var(--fox), var(--fox-light));
  border: none;
  color: white;
  padding: 13px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  box-shadow: 0 8px 20px rgba(232, 98, 10, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(232, 98, 10, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

/* LIST CARD */
.list-card {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.list-card h3 {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--cream);
}

.data-table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--dark3);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.data-table th:first-child { border-radius: 8px 0 0 8px; }
.data-table th:last-child { border-radius: 0 8px 8px 0; }

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--primary-light);
}

.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--fox-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 2px solid var(--fox);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-eng {
  background: rgba(74, 144, 217, 0.1);
  color: #4A90D9;
}

.badge-ger {
  background: rgba(45, 158, 107, 0.1);
  color: #2D9E6B;
}

.btn-delete {
  background: transparent;
  border: 1px solid rgba(232, 64, 64, 0.2);
  color: var(--red);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 600;
  transition: all 0.2s;
}

.btn-delete:hover {
  background: rgba(232, 64, 64, 0.05);
  border-color: rgba(232, 64, 64, 0.4);
}

.btn-remove {
  background: rgba(232, 64, 64, 0.05);
  border: 1px solid rgba(232, 64, 64, 0.2);
  color: var(--red);
  padding: 13px 22px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  transition: all 0.2s;
}

.btn-remove:hover {
  background: rgba(232, 64, 64, 0.1);
  border-color: rgba(232, 64, 64, 0.4);
}

.assign-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assign-tag {
  background: var(--fox-dim);
  border: 1px solid var(--border);
  color: var(--fox);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(26, 18, 0, 0.12);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 9999;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success { border-color: var(--green); }
.toast-error { border-color: var(--red); }

/* MODAL STYLES */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 18, 0, 0.4);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.3s;
}

.modal-content {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  width: 800px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(26, 18, 0, 0.15);
  position: relative;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  0% { transform: translateY(50px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.btn-close {
  transition: color 0.18s;
}

.btn-close:hover {
  color: var(--fox) !important;
}

/* BRAND LOGO */
.logo-brand {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 22px;
  background: linear-gradient(135deg, var(--fox) 0%, #FF8533 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.8px;
  line-height: 1;
  text-transform: none;
  filter: drop-shadow(0 2px 4px rgba(232, 98, 10, 0.1));
}

/* INTERACTIVE CLASSROOM MANAGEMENT TAB Styles */
.ic-type-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.ic-type-game {
  background: rgba(45, 158, 107, 0.1);
  color: #2D9E6B;
  border: 1px solid rgba(45, 158, 107, 0.2);
}
.ic-type-quiz {
  background: rgba(232, 64, 64, 0.1);
  color: #E84040;
  border: 1px solid rgba(232, 64, 64, 0.2);
}
.ic-type-activity {
  background: rgba(232, 98, 10, 0.1);
  color: #E8620A;
  border: 1px solid rgba(232, 98, 10, 0.2);
}
.ic-type-lesson {
  background: rgba(156, 107, 64, 0.1);
  color: #9C6B40;
  border: 1px solid rgba(156, 107, 64, 0.2);
}

/* Premium Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(232, 98, 10, 0.02);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(232, 98, 10, 0.2);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(232, 98, 10, 0.45);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* TABS STYLES FOR CONTENT MANAGER */
.cm-tab-btn {
  background: var(--dark3) !important;
  border: 1px solid var(--border) !important;
  color: var(--cream2) !important;
  padding: 10px 20px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  font-family: var(--font) !important;
  transition: all 0.2s !important;
  box-shadow: none !important;
  width: auto !important;
  margin: 0 !important;
}

.cm-tab-btn:hover {
  background: var(--fox-dim) !important;
  color: var(--fox) !important;
  border-color: var(--fox) !important;
}

.cm-tab-btn.active {
  background: linear-gradient(135deg, var(--fox), var(--fox-light)) !important;
  color: white !important;
  border-color: var(--fox) !important;
  box-shadow: 0 4px 16px rgba(232, 98, 10, 0.2) !important;
}

.btn-secondary {
  background: var(--primary-light);
  border: 1px solid rgba(232, 98, 10, 0.15);
  color: var(--fox);
  padding: 13px 22px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: var(--fox);
  color: white;
  border-color: var(--fox);
}

