/* --- Global Styles --- */
:root {
  --primary-color: #0d6efd;
  --primary-gradient: linear-gradient(135deg, #0d6efd 0%, #0099ff 100%);
  --text-main: #1f2937;
  --bg-light: #f3f4f6;
}

body {
  font-family: "Noto Sans Lao", "Poppins", sans-serif;
  background-color: var(--bg-light);
  color: var(--text-main);
  transition: background-color 0.3s, color 0.3s; /* Smooth Transition */
}

/* --- Navbar Styles --- */
.sticky-nav-wrapper {
  position: sticky;
  top: 20px;
  z-index: 1030;
  padding: 0 15px;
}
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 0.8rem 1.5rem;
}
.navbar-brand {
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #0d6efd 0%, #00c6ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-link {
  font-weight: 600;
  color: #4b5563 !important;
  margin: 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  transition: color 0.3s;
}
.nav-link i {
  font-size: 1rem;
  transition: transform 0.2s;
  color: #6b7280;
}
.nav-link:hover,
.nav-link.active {
  color: var(--primary-color) !important;
}
.nav-link:hover i,
.nav-link.active i {
  color: var(--primary-color);
}
.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 3px;
  bottom: -5px;
  left: 50%;
  background: var(--primary-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 10px;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Dropdown Logic */
.dropdown-toggle::after {
  display: none !important;
}
.dropdown-arrow {
  font-size: 0.75rem !important;
  transition: transform 0.3s ease;
  margin-left: 4px;
}
@media (min-width: 992px) {
  .nav-item.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.3s ease forwards;
  }
  .nav-item.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--primary-color);
  }
}
.dropdown-menu {
  border: none;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  margin-top: 10px !important;
  padding: 10px;
  min-width: 230px;
  display: none;
}
.nav-item.dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 30px;
  background: transparent;
  z-index: 100;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.dropdown-item {
  border-radius: 8px;
  padding: 10px 15px;
  font-weight: 500;
  color: #555;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}
.dropdown-item:hover {
  background-color: #f0f7ff;
  color: var(--primary-color);
  transform: translateX(5px);
}

/* Icons & Buttons */
.icon-it {
  color: #f59e0b;
}
.icon-net {
  color: #0ea5e9;
}
.icon-dev {
  color: #8b5cf6;
}
.icon-ai {
  color: #10b981;
}
.icon-all {
  color: #6b7280;
}
.btn-login {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  font-weight: 700;
  border-radius: 50px;
  padding: 6px 20px;
  transition: all 0.3s;
}
.btn-login:hover {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}
.btn-search-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d6efd 0%, #0099ff 100%);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 5px 15px rgba(13, 110, 253, 0.2);
}
.btn-search-circle:hover {
  transform: translateY(-2px) rotate(10deg);
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.4);
}

/* --- Hero & Cards --- */
.hero-section {
  padding-top: 3rem;
  padding-bottom: 2rem;
}
.hero-card-cinematic {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  height: 500px;
  cursor: pointer;
  transition: transform 0.4s ease;
}
.hero-card-cinematic:hover {
  transform: translateY(-5px);
}
.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.hero-card-cinematic:hover .hero-bg-img {
  transform: scale(1.05);
}
.hero-content-glass {
  position: absolute;
  bottom: 30px;
  left: 30px;
  right: 30px;
  max-width: 650px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 2rem;
  color: white;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transform: translateY(0);
  transition: transform 0.4s ease, background 0.4s;
}
.hero-card-cinematic:hover .hero-content-glass {
  background: rgba(0, 0, 0, 0.75);
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.3);
}
.hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, #0d6efd 0%, #0099ff 100%);
  color: white;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1rem;
  box-shadow: 0 4px 10px rgba(13, 110, 253, 0.4);
}
.hero-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.hero-meta {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 15px;
}

.post-card {
  border: none;
  border-radius: 16px;
  background: white;
  height: 100%;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}
.post-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}
.post-img-wrapper {
  height: 220px;
  overflow: hidden;
  position: relative;
}
.post-img-top {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.post-card:hover .post-img-top {
  transform: scale(1.1);
}
.category-tag {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 2;
  text-transform: uppercase;
}
.post-meta {
  font-size: 0.8rem;
  color: #9ca3af;
}
.card-title a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a:hover {
  color: var(--primary-color);
}

/* --- Footer Styles --- */
.footer-section {
  background: #151414;
  position: relative;
  padding-top: 80px;
  color: #878787;
  margin-top: 80px;
}
.footer-logo {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  font-family: "Poppins", sans-serif;
}
.footer-logo a {
  color: #fff;
  text-decoration: none;
}
.footer-text p {
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 28px;
}
.footer-social-icon span {
  color: #fff;
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
}
.footer-social-icon a {
  color: #fff;
  font-size: 16px;
  margin-right: 15px;
  display: inline-block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 50%;
  transition: all 0.3s;
}
.footer-social-icon a:hover {
  transform: translateY(-5px);
}
.facebook-bg {
  background: #3b5998;
}
.twitter-bg {
  background: #55acee;
}
.google-bg {
  background: #dd4b39;
}
.footer-widget-heading h3 {
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 40px;
  position: relative;
}
.footer-widget-heading h3::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -15px;
  height: 2px;
  width: 50px;
  background: var(--primary-color);
}
.footer-widget ul li {
  display: inline-block;
  width: 50%;
  margin-bottom: 12px;
}
.footer-widget ul li a {
  color: #878787;
  text-decoration: none;
  text-transform: capitalize;
  transition: all 0.3s;
}
.footer-widget ul li a:hover {
  color: var(--primary-color);
  padding-left: 5px;
}
.copyright-area {
  background: #202020;
  padding: 25px 0;
  margin-top: 50px;
}
.copyright-text p {
  margin: 0;
  font-size: 14px;
  color: #878787;
}
.copyright-text p a {
  color: var(--primary-color);
  text-decoration: none;
}

/* --- Page Specifics --- */
.about-header,
.contact-header {
  background: white;
  padding: 80px 0;
  text-align: center;
  border-radius: 0 0 50px 50px;
  margin-top: -20px;
  padding-top: 100px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}
.contact-header {
  background: linear-gradient(135deg, #0d6efd 0%, #0099ff 100%);
  color: white;
  margin-bottom: 3rem;
}
.about-title {
  font-weight: 800;
  font-size: 3rem;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #0d6efd 0%, #00c6ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.mission-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  height: 100%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
}
.mission-card:hover {
  transform: translateY(-10px);
}
.mission-icon {
  width: 80px;
  height: 80px;
  background: #eff6ff;
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
}
.team-member {
  text-align: center;
  margin-bottom: 30px;
}
.team-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  border: 5px solid white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.team-name {
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 5px;
}
.team-role {
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 500;
}
.contact-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  height: 100%;
}
.form-control,
.form-select {
  padding: 12px 15px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background-color: #f9fafb;
}
.form-control:focus {
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
  border-color: var(--primary-color);
}
.contact-info-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 2rem;
}
.contact-icon {
  width: 50px;
  height: 50px;
  background: rgba(13, 110, 253, 0.1);
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-right: 1.2rem;
  flex-shrink: 0;
}
.map-container {
  border-radius: 20px;
  overflow: hidden;
  height: 300px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}
.page-header {
  padding: 3rem 0 2rem;
  text-align: center;
}
.page-title {
  font-weight: 800;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: #333;
}
.page-subtitle {
  color: #6c757d;
  font-size: 1.1rem;
}
.article-container {
  padding-top: 2rem;
}
.article-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin-bottom: 2rem;
}
.article-header {
  padding: 2.5rem 2.5rem 0;
}
.article-title {
  font-weight: 700;
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}
.article-image {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  border-radius: 15px;
  margin-bottom: 2rem;
}
.article-content {
  padding: 0 2.5rem 2.5rem;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
}
.sidebar-widget {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
  margin-bottom: 1.5rem;
}
.widget-title {
  font-weight: 700;
  margin-bottom: 1.2rem;
  position: relative;
  padding-bottom: 10px;
}
.widget-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 5px;
}
.mini-post {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s;
}
.mini-post:hover {
  transform: translateX(5px);
}
.mini-post-img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}
.mini-post-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mini-post-date {
  font-size: 0.75rem;
  color: #999;
}
.related-card {
  border: none;
  border-radius: 12px;
  background: white;
  height: 100%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s;
}
.related-card:hover {
  transform: translateY(-5px);
}
.related-img {
  height: 180px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}

/* --- Dark Mode Styles --- */

/* 1. Backgrounds & Colors */
body.dark-mode {
  background-color: #111827 !important;
  color: #f3f4f6 !important;
}

/* 2. Cards & White Backgrounds */
body.dark-mode .card,
body.dark-mode .bg-white,
body.dark-mode .article-card,
body.dark-mode .sidebar-widget,
body.dark-mode .mission-card,
body.dark-mode .contact-card,
body.dark-mode .about-header,
body.dark-mode .related-card,
body.dark-mode .dropdown-menu,
body.dark-mode .admin-header,
body.dark-mode .folder-sidebar,
body.dark-mode .media-content {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
  border-color: #374151 !important;
  box-shadow: none !important;
}

/* 3. Navbar Dark Mode */
body.dark-mode .navbar {
  background-color: rgba(31, 41, 55, 0.95) !important;
  border-color: #374151 !important;
}
body.dark-mode .navbar-brand,
body.dark-mode .nav-link {
  color: #f3f4f6 !important;
}
body.dark-mode .nav-link:hover,
body.dark-mode .nav-link.active {
  color: #0d6efd !important;
  background-color: rgba(37, 99, 235, 0.1) !important;
}

/* 4. Form Inputs (Search, Contact) */
body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .search-input-expand,
body.dark-mode .input-group-text {
  background-color: #2d2d2d !important;
  border-color: #4b5563 !important;
  color: #ffffff !important;
}

body.dark-mode .form-control::placeholder,
body.dark-mode .search-input-expand::placeholder {
  color: #9ca3af !important;
  opacity: 0.8;
}

body.dark-mode .search-box-expand {
  background-color: #2d2d2d !important;
  border-color: #4b5563 !important;
}

/* 5. Typography Override */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode .text-dark,
body.dark-mode .card-title a,
body.dark-mode .mini-post-title {
  color: #ffffff !important;
}

/* Fix Content Text Color in Dark Mode (NEW) */
body.dark-mode p,
body.dark-mode .card-body,
body.dark-mode .article-content,
body.dark-mode .content-body {
  color: #e0e0e0 !important;
}

body.dark-mode .text-muted,
body.dark-mode .small,
body.dark-mode .form-text {
  color: #9ca3af !important;
}

body.dark-mode .text-secondary {
  color: #d1d5db !important;
}

/* 6. Dropdowns */
body.dark-mode .dropdown-item {
  color: #e5e7eb !important;
}
body.dark-mode .dropdown-item:hover {
  background-color: #374151 !important;
  color: #fff !important;
}

/* 7. Utility Classes */
body.dark-mode .bg-light {
  background-color: #374151 !important;
}
body.dark-mode .border {
  border-color: #374151 !important;
}
body.dark-mode .shadow-sm {
  box-shadow: none !important;
}

/* Fix specific elements */
body.dark-mode .mission-icon {
  background-color: #374151 !important;
}
body.dark-mode .team-img {
  border-color: #1e1e1e !important;
}
body.dark-mode .file-thumb {
  background-color: #2d2d2d !important;
  border-color: #374151 !important;
}
