@import url("https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap");

:root {
  --primary-blue: #2196f3;
  --primary-dark: #1976d2;
  --accent-red: #ff2d55;
  --bg-gray: #bdc0c4;
  --card-bg: #ffffff;
  --text-color: #333333;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

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

body {
  font-family: "Sarabun", "Tahoma", sans-serif;
  background: linear-gradient(135deg, #e0eafc 0%, #cfdef3 100%);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background-color: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 1rem;
}

header img {
  height: 60px;
}

.header-text h1 {
  font-size: 1.5rem;
  color: var(--primary-dark);
  margin-bottom: 0.2rem;
}

.header-text p {
  font-size: 0.9rem;
  color: #666;
}

main {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  main {
    grid-template-columns: 1fr;
  }
}

/* Cloned Styles */
.box-system {
  background-image: url("https://std2018.moe.go.th/web/vec/ui/img/bg/bg-news.png");
  background-color: #ffffff;
  background-repeat: no-repeat;
  background-position: right -110px bottom -210px;
  box-shadow: 1px 1px 2px 1px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  width: 240px;
  height: 140px;
  padding: 2px;
  text-align: center;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.box-system:hover {
  transform: translateY(-2px);
  box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.2);
}

.box-system a {
  text-decoration: none;
  display: block;
  width: 100%;
}

.box-system img {
  height: 90px;
  margin-bottom: 5px;
}

.box-text {
  font-family: "Sarabun", "Pridi", Arial, sans-serif;
  font-size: 16px;
  color: #797979;
  font-weight: 500;
}

.link-default:hover .box-text {
  color: #ef6c00;
}

/* Layout adjustments */
.main-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  max-width: 600px;
  margin: 0 auto;
}

footer {
  background-color: #f5f5f5;
  text-align: center;
  padding: 15px;
  font-size: 12px;
  color: #666;
  border-top: 1px solid #ddd;
  margin-top: auto;
  line-height: 1.6;
}

/* Login Page Styles */
.login-container {
  max-width: 900px;
  margin: 3rem auto;
  background: white;
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex;
  overflow: hidden;
}

.login-illustration {
  flex: 1;
  background: linear-gradient(135deg, #2196f3 0%, #21cbf3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-illustration img {
  max-width: 80%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.login-form-wrapper {
  flex: 1;
  padding: 3rem;
}

.login-form-wrapper h2 {
  color: var(--primary-dark);
  margin-bottom: 2rem;
  text-align: center;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #555;
}

.form-control {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
}

.form-control:focus {
  border-color: var(--primary-blue);
  outline: none;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.btn-login {
  width: 100%;
  padding: 1rem;
  background-color: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-login:hover {
  background-color: var(--primary-dark);
}

.back-link {
  display: block;
  text-align: center;
  margin-top: 1rem;
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  color: var(--primary-blue);
}

/* Staff Dashboard Styles from Screenshot */
:root {
  --header-red: #a81c1c;
  /* Deep red for top bar */
  --sidebar-width: 260px;
  --card-orange: #ff9800;
  --card-blue: #0088cc;
  --card-green: #4caf50;
  --bg-gray-light: #f1f1f1;
}

body.dashboard-body {
  background-color: var(--bg-gray-light);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  font-family: "Sarabun", sans-serif;
}

.dashboard-header {
  background: linear-gradient(to bottom, #a00000 0%, #800000 100%);
  color: white;
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  flex-shrink: 0;
}

.dashboard-header .logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-header .logo-area img {
  height: 36px;
  width: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.header-title h1 {
  font-size: 1rem;
  margin: 0;
  font-weight: 500;
}

.header-title p {
  font-size: 0.75rem;
  margin: 0;
  opacity: 0.8;
}

.dashboard-header .right-area {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.85rem;
}

.user-profile-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 10px 2px 2px;
  border-radius: 20px;
}

.user-profile-mini img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ccc;
}

.logout-btn {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

.dashboard-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.dashboard-sidebar {
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu li {
  border-bottom: 1px solid #f0f0f0;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: #555;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
  background-color: #f8f8f8;
  color: #333;
  border-left: 4px solid var(--card-orange);
}

.sidebar-menu li a img {
  width: 20px;
  margin-right: 10px;
}

.sidebar-menu li a .material-icons {
  margin-right: 10px;
  font-size: 20px;
  color: #666;
  width: 24px;
  text-align: center;
}

/* Content Area */
.dashboard-content {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 15px;
  align-items: start;
}

.card-box {
  background: white;
  border: 1px solid #c5c5c5;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card-header {
  padding: 8px 15px;
  color: white;
  font-weight: normal;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bg-orange {
  background: var(--card-orange);
}

.bg-blue {
  background: var(--card-blue);
}

.bg-green {
  background: var(--card-green);
}

.bg-red {
  background: var(--accent-red);
}

.card-body {
  padding: 15px;
}

/* Profile specific */
.profile-large {
  text-align: center;
  padding-bottom: 10px;
}

.profile-large img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid #ddd;
  margin-bottom: 15px;
}

.profile-info-table {
  width: 100%;
  font-size: 0.9rem;
  color: #333;
}

.profile-info-table td {
  padding: 5px 0;
  vertical-align: top;
}

.profile-info-table .label {
  color: #777;
  width: 40%;
}

.profile-actions {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.btn-sm-edit {
  font-size: 0.8rem;
  padding: 4px 10px;
  background: #fdfdfd;
  border: 1px solid #ccc;
  border-radius: 3px;
  text-decoration: none;
  color: #333;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* News List */
.news-item {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.news-title {
  color: #d32f2f;
  font-weight: bold;
  font-size: 1rem;
  display: block;
  margin-bottom: 5px;
}

.news-desc {
  color: #444;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* System Page Styles */
.system-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  padding: 10px 0;
}

@media (max-width: 1200px) {
  .system-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .system-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.system-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.system-link:hover {
  color: var(--primary-blue);
}

.system-link img {
  margin-right: 8px;
  width: 24px;
  height: 24px;
}

.system-link .material-icons {
  margin-right: 8px;
  font-size: 20px;
  color: #666;
  width: 24px;
  text-align: center;
}

.breadcrumb {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.breadcrumb a {
  color: #888;
  text-decoration: none;
}

.breadcrumb .separator {
  margin: 0 5px;
}

.bg-purple {
  background-color: #ba68c8;
}

@media (max-width: 768px) {
  .dashboard-container {
    flex-direction: column;
    height: auto;
    overflow-y: auto;
  }

  .dashboard-sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #ddd;
    overflow-y: visible;
  }

  .dashboard-content {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .dashboard-header {
    height: auto;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }

  .dashboard-header .logo-area {
    width: 100%;
    justify-content: center;
    margin-bottom: 5px;
  }

  .dashboard-header .right-area {
    width: 100%;
    justify-content: center;
    margin-left: 0;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .header-title {
    text-align: center;
  }
  
  .main-grid {
    grid-template-columns: 1fr;
  }
  
  /* Adjust login page for mobile */
  .login-container {
    flex-direction: column;
    margin: 1rem;
  }
  
  .login-illustration {
    padding: 2rem 1rem;
  }
  
  .login-form-wrapper {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .system-grid {
    grid-template-columns: 1fr;
  }
  
  .header-title h1 {
    font-size: 0.9rem;
  }
  
  .header-title p {
    font-size: 0.7rem;
  }
  
  .dashboard-header .right-area {
    font-size: 0.75rem;
  }
}
