/* index.css */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  /* Colors - Light Theme */
  --primary: #0f172a;
  --primary-light: #1e293b;
  --primary-rgb: 15, 23, 42;
  --accent: #d97706;
  --accent-light: #f59e0b;
  --accent-hover: #b45309;
  --bg-main: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-sidebar: #ffffff;
  --text-main: #334155;
  --text-title: #0f172a;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  
  /* Fonts */
  --font-title: 'Kanit', sans-serif;
  --font-body: 'Sarabun', sans-serif;
  
  /* Layout */
  --radius: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables override */
[data-theme="dark"] {
  --primary: #1e293b;
  --primary-light: #0f172a;
  --primary-rgb: 30, 41, 59;
  --bg-main: #0b0f19;
  --bg-card: rgba(22, 30, 49, 0.85);
  --bg-sidebar: #111827;
  --text-main: #cbd5e1;
  --text-title: #f8fafc;
  --text-light: #94a3b8;
  --border: #334155;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  color: var(--text-title);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

button, .btn {
  font-family: var(--font-title);
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
}

/* Layout Elements */
.header-banner {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.95), rgba(var(--primary-rgb), 0.8)), url('https://images.unsplash.com/photo-1498243691581-b145c3f54a5c?q=80&w=1200&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  color: white;
  padding: 3.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.header-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top right, rgba(217, 119, 6, 0.2), transparent 60%);
  pointer-events: none;
}

.header-logo {
  max-width: 90px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.header-banner h1 {
  color: #ffffff;
  font-size: 2.2rem;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header-banner p {
  font-size: 1.1rem;
  color: #cbd5e1;
  max-width: 800px;
  margin: 0.5rem auto 0 auto;
  font-weight: 300;
}

/* Navigation bar */
.nav-container {
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.nav-links {
  display: flex;
  list-style: none;
  overflow-x: auto;
}

.nav-link {
  font-family: var(--font-title);
  padding: 1.2rem 1.2rem;
  color: var(--text-light);
  font-weight: 500;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Theme Toggle Button */
.theme-btn, .admin-login-toggle-btn {
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
}

.theme-btn:hover, .admin-login-toggle-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Main Container */
.main-wrapper {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  min-height: 70vh;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Buttons Styles */
.btn-primary {
  background-color: var(--accent);
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  box-shadow: 0 4px 6px -1px rgba(217, 119, 6, 0.2);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: white;
}

.btn-secondary {
  background-color: var(--primary);
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
}

.btn-secondary:hover {
  background-color: var(--primary-light);
}

/* Card Styles */
.card {
  background-color: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* HOME TAB */
.welcome-section {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .welcome-section {
    grid-template-columns: 1fr;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-box {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.03), rgba(var(--primary-rgb), 0.07));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.stat-box h4 {
  font-size: 2.2rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.stat-box p {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* News PR Section */
.section-header {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
  border: 1px solid var(--border);
}

.news-date {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.news-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  line-height: 1.4;
  height: 2.8rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.news-summary {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 1.2rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* CURRICULUM & COURSES TAB */
.curriculum-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .curriculum-info {
    grid-template-columns: 1fr;
  }
}

.curriculum-list {
  list-style: none;
  margin-top: 1rem;
}

.curriculum-list li {
  padding: 0.8rem 0;
  border-bottom: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
}

.courses-filter {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-size: 0.9rem;
  white-space: nowrap;
  font-weight: 500;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.course-card {
  cursor: pointer;
  border-left: 4px solid var(--accent);
  padding: 1.5rem;
}

.course-card .course-code {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.course-card h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.course-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-light);
  border-top: 1px dashed var(--border);
  padding-top: 0.8rem;
}

.course-card:hover {
  border-left-color: var(--primary);
  background-color: rgba(var(--primary-rgb), 0.02);
}

/* ADMISSION TAB */
.admission-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .admission-grid {
    grid-template-columns: 1fr;
  }
}

.timeline-flow {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--border);
  margin-top: 1.5rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 0.2rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-main);
  box-shadow: 0 0 0 3px var(--border);
}

.timeline-date {
  font-family: var(--font-title);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.timeline-event {
  font-size: 1rem;
  color: var(--text-title);
}

/* GALLERY TAB */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  height: 250px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  padding: 1.5rem 1.2rem;
  color: white;
  transform: translateY(100%);
  transition: var(--transition);
}

.gallery-card:hover img {
  transform: scale(1.1);
}

.gallery-card:hover .gallery-overlay {
  transform: translateY(0);
}

.gallery-overlay h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.gallery-overlay p {
  font-size: 0.8rem;
  color: #cbd5e1;
}

/* MODAL SYSTEM */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-content {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
}

.close-btn:hover {
  color: var(--text-title);
}

/* Course Modal Detail CSS */
.course-detail-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.2rem;
  margin-bottom: 1.5rem;
}

.course-detail-header .code {
  font-size: 1.2rem;
  color: var(--accent);
  font-family: var(--font-title);
  font-weight: 600;
}

.course-detail-header h2 {
  font-size: 1.5rem;
  line-height: 1.3;
}

.course-detail-section {
  margin-bottom: 1.5rem;
}

.course-detail-section h4 {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  font-weight: 500;
}

.course-detail-section p {
  font-size: 1rem;
  line-height: 1.6;
  text-align: justify;
}

/* Lightbox System */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox img {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border-radius: 4px;
}

.lightbox-title {
  color: white;
  margin-top: 1rem;
  font-size: 1.2rem;
  font-family: var(--font-title);
}

/* ADMIN PANEL DESIGN */
.admin-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .admin-container {
    grid-template-columns: 1fr;
  }
}

.admin-sidebar {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-menu-btn {
  background: transparent;
  color: var(--text-main);
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  text-align: left;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-menu-btn:hover, .admin-menu-btn.active {
  background-color: rgba(var(--accent), 0.1);
  color: var(--accent);
}

.admin-content-section {
  display: none;
}

.admin-content-section.active {
  display: block;
}

/* Admin Form controls */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-family: var(--font-title);
  color: var(--text-title);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--bg-sidebar);
  color: var(--text-main);
  font-family: var(--font-body);
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn-bar {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Admin Data Tables */
.admin-table-container {
  overflow-x: auto;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background-color: var(--bg-sidebar);
}

.admin-table th, .admin-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  background-color: rgba(var(--primary-rgb), 0.03);
  font-family: var(--font-title);
  font-weight: 500;
  color: var(--text-title);
}

.admin-table tr:hover {
  background-color: rgba(var(--primary-rgb), 0.01);
}

.action-btn-group {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.9rem;
  background-color: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-icon:hover {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-icon.delete:hover {
  background-color: #ef4444;
  color: white;
  border-color: #ef4444;
}

/* Footer Section */
.footer {
  background-color: var(--primary);
  color: #cbd5e1;
  padding: 3rem 2rem 2.5rem 2rem;
  margin-top: 5rem;
  border-top: 4px solid var(--accent);
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.footer-logo-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-logo-text h3 {
  color: white;
  font-size: 1.3rem;
}

.footer-links h4, .footer-contact h4 {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-links h4::after, .footer-contact h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 30px;
  height: 2px;
  background-color: var(--accent);
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.footer-links a {
  color: #94a3b8;
}

.footer-links a:hover {
  color: white;
  padding-left: 5px;
}

.footer-contact p {
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}

/* Contact Form Grid inside Admissions tab */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* Notification banner */
.toast-msg {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: #10b981;
  color: white;
  padding: 1rem 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-weight: 500;
  z-index: 3000;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Admin Lock / Login Screen */
.admin-lock-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.admin-lock-card {
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.admin-lock-icon {
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* LECTURER CARD STYLES */
.lecturer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.lecturer-card img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.lecturer-card:hover img {
  transform: scale(1.05);
  border-color: var(--primary);
}

.lecturer-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
  color: var(--text-title);
}

.lecturer-card .pos {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1rem;
}

.lecturer-card .degrees {
  font-size: 0.85rem;
  color: var(--text-light);
  text-align: left;
  border-top: 1px dashed var(--border);
  padding-top: 0.8rem;
  width: 100%;
}

.lecturer-card .degrees li {
  margin-bottom: 0.4rem;
  list-style-type: none;
  padding-left: 1rem;
  position: relative;
  line-height: 1.4;
}

.lecturer-card .degrees li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
}

