:root {
  --primary: #1a6b3c;
  --primary-dark: #0f4d2a;
  --primary-darker: #0a361e;
  --primary-light: #2a8f52;
  --primary-lighter: #3aaf66;
  --primary-gradient: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  --primary-gradient-reverse: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 50%, var(--primary-dark) 100%);
  --secondary: #c9951e;
  --secondary-light: #e8b84a;
  --secondary-gradient: linear-gradient(135deg, #c9951e 0%, #e8b84a 100%);
  --accent: #4a90d9;
  --dark: #1a1a2e;
  --dark-soft: #252540;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --white: #ffffff;
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-md: 0 6px 30px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --shadow-xl: 0 12px 50px rgba(0,0,0,0.15);
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

* { box-sizing: border-box; }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'Poppins', 'Noto Serif Bengali', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

body {
  font-family: 'Inter', 'Noto Serif Bengali', 'Segoe UI', Tahoma, sans-serif;
  background: var(--gray-100);
  color: #333;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Top Bar */
.top-bar {
  background: var(--dark);
  padding: 6px 0;
  font-size: 13px;
  letter-spacing: 0.3px;
  position: relative;
  z-index: 1030;
}
.top-bar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}
.top-bar a { color: rgba(255,255,255,0.75); text-decoration: none; transition: var(--transition); }
.top-bar a:hover { color: var(--secondary-light); }
.top-bar .social-icons a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.08); margin-left: 6px;
  transition: var(--transition); font-size: 12px;
}
.top-bar .social-icons a:hover { background: var(--secondary); color: #fff; transform: translateY(-1px); }

/* Header / Logo Area */
.header-brand {
  background: var(--primary-gradient);
  padding: 16px 0;
  position: relative;
  overflow: hidden;
}
.header-brand::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(255,255,255,0.04) 0%, transparent 50%),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.04"><path d="M50 15 L61 38 L86 40 L67 57 L72 82 L50 68 L28 82 L33 57 L14 40 L39 38 Z" fill="white"/></svg>') repeat;
  background-size: 80px;
  pointer-events: none;
}
.header-brand .institute-name {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
  letter-spacing: 0.3px;
  line-height: 1.2;
}
.header-brand .institute-address {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: 0.2px;
}
@media (max-width: 768px) {
  .header-brand { padding: 12px 0; }
  .header-brand .institute-name { font-size: 18px; }
  .header-brand .institute-address { font-size: 12px; }
}

/* Navigation */
.main-nav {
  background: rgba(255,255,255,0.98) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
  padding: 0 !important;
  transition: var(--transition);
}
.main-nav .navbar-nav .nav-link {
  padding: 16px 14px !important;
  color: var(--dark) !important;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: var(--transition);
  position: relative;
}
.main-nav .navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--primary-gradient);
  transition: var(--transition);
  border-radius: 3px 3px 0 0;
}
.main-nav .navbar-nav .nav-link:hover::after,
.main-nav .navbar-nav .nav-link.active::after { width: 70%; }
.main-nav .navbar-nav .nav-link:hover,
.main-nav .navbar-nav .nav-link.active { color: var(--primary) !important; }

.main-nav .dropdown-menu {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  margin-top: 4px !important;
  min-width: 220px;
  border: 1px solid rgba(0,0,0,0.04);
  animation: dropdownFade 0.2s ease;
}
@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.main-nav .dropdown-menu .dropdown-item {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #444;
  transition: var(--transition);
}
.main-nav .dropdown-menu .dropdown-item:hover {
  background: var(--primary-gradient);
  color: #fff;
  transform: translateX(4px);
}
.main-nav .navbar-toggler {
  border: none;
  padding: 10px;
}
.main-nav .navbar-toggler:focus { box-shadow: none; }
.main-nav .navbar-toggler .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%231a6b3c' stroke-linecap='round' stroke-miterlimit='10' stroke-width='3' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@media (max-width: 991.98px) {
  .main-nav .navbar-nav { padding: 10px 0; }
  .main-nav .navbar-nav .nav-link { padding: 10px 14px !important; border-radius: 6px; }
  .main-nav .navbar-nav .nav-link::after { display: none; }
  .main-nav .dropdown-menu { box-shadow: none; padding-left: 16px; border: none; animation: none; }
}

/* Main Content Area */
.main-content {
  min-height: 500px;
  padding: 30px 0;
}

.page-section {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  margin-bottom: 30px;
  transition: var(--transition);
}
.page-section:hover { box-shadow: var(--shadow-md); }

/* Section Title */
.section-title-wrap {
  text-align: center;
  margin-bottom: 40px;
}
.section-title-wrap h2 {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary-dark);
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
}
.section-title-wrap h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--secondary-gradient);
  border-radius: 4px;
  margin: 12px auto 0;
}
.section-title-wrap p {
  color: var(--gray-600);
  font-size: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* Cards */
.card-modern {
  background: #fff;
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  overflow: hidden;
}
.card-modern:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card-modern .card-header-custom {
  padding: 16px 24px;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  background: var(--primary-gradient);
  letter-spacing: 0.3px;
}
.card-modern .card-body-custom {
  padding: 24px;
}

/* Page Title */
.page-title-wrap {
  background: var(--primary-gradient);
  padding: 44px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-title-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(circle at 30% 50%, rgba(255,255,255,0.06) 0%, transparent 50%),
    radial-gradient(circle at 70% 50%, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}
.page-title-wrap h2 {
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.15);
  position: relative;
}
.page-title-wrap p {
  color: rgba(255,255,255,0.85);
  margin: 8px 0 0;
  font-size: 16px;
  position: relative;
}

/* Tables */
.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table-modern thead th {
  background: var(--primary-gradient);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 14px 18px;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.table-modern tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}
.table-modern tbody tr:hover {
  background: #f0faf4;
}
.table-modern tbody tr:last-child td {
  border-bottom: none;
}

/* Stat Cards */
.stat-card {
  background: var(--primary-gradient);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.stat-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); }
.stat-card .stat-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.9; }
.stat-card .stat-number { font-size: 42px; font-weight: 800; line-height: 1.2; }
.stat-card .stat-label { font-size: 16px; opacity: 0.9; font-weight: 500; }
.stat-card.stat-red { background: linear-gradient(135deg, #c0392b, #e74c3c); }
.stat-card.stat-blue { background: linear-gradient(135deg, #1a5276, #2e86c1); }
.stat-card.stat-orange { background: linear-gradient(135deg, #d35400, #e67e22); }

/* Counter Cards (homepage) */
.counter-card-modern {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  height: 100%;
  border: 1px solid rgba(0,0,0,0.03);
  position: relative;
  overflow: hidden;
}
.counter-card-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: var(--transition);
}
.counter-card-modern:hover::before { opacity: 1; }
.counter-card-modern:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}
.counter-card-modern .counter-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 26px;
  color: #fff;
  position: relative;
}
.counter-card-modern .counter-icon-wrap::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  opacity: 0;
  transition: var(--transition);
}
.counter-card-modern:hover .counter-icon-wrap::after { opacity: 1; }
.counter-card-modern .counter-number {
  font-size: 40px;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.1;
  font-family: 'Poppins', sans-serif;
}
.counter-card-modern .counter-label {
  font-size: 15px;
  color: var(--gray-600);
  font-weight: 500;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Message Cards */
.message-card-modern {
  background: #fff;
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
  transition: var(--transition);
  position: relative;
}
.message-card-modern:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.message-card-modern .msg-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--primary-light);
  padding: 3px;
  background: #fff;
  flex-shrink: 0;
}
.message-card-modern .msg-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
}
.message-card-modern .msg-designation {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 2px;
}
.message-card-modern .msg-text {
  margin-top: 16px;
  font-size: 14px;
  color: #555;
  text-align: justify;
  line-height: 1.8;
  border-top: 1px solid var(--gray-200);
  padding-top: 16px;
}

/* Notice Board */
.notice-board-modern {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}
.notice-board-modern:hover { box-shadow: var(--shadow-md); }
.notice-board-modern .notice-head {
  background: var(--primary-gradient);
  padding: 16px 24px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.3px;
}
.notice-board-modern .notice-body { padding: 8px; }
.notice-board-modern .notice-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  transition: var(--transition);
  text-decoration: none;
  color: #444;
  border-radius: 6px;
  margin: 2px 0;
}
.notice-board-modern .notice-item:last-child { border-bottom: none; }
.notice-board-modern .notice-item:hover {
  background: #f0faf4;
  padding-left: 20px;
  color: var(--primary-dark);
}
.notice-board-modern .notice-item .notice-icon {
  color: var(--primary);
  font-size: 14px;
  margin-top: 3px;
  flex-shrink: 0;
}
.notice-board-modern .notice-item .notice-text {
  font-size: 14px;
  line-height: 1.5;
}

/* Buttons */
.btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 28px;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  transition: var(--transition);
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 0.3px;
}
.btn-modern-primary {
  background: var(--primary-gradient);
  color: #fff;
}
.btn-modern-primary:hover {
  background: var(--primary-gradient-reverse);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 107, 60, 0.35);
}
.btn-modern-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-modern-outline:hover {
  background: var(--primary-gradient);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 107, 60, 0.2);
}

/* Footer */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  padding: 60px 0 0;
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
}
.site-footer h5 {
  color: #fff;
  font-weight: 700;
  margin-bottom: 20px;
  font-size: 17px;
  position: relative;
  padding-bottom: 12px;
  letter-spacing: 0.3px;
}
.site-footer h5::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--secondary-gradient);
  border-radius: 3px;
}
.site-footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: var(--transition);
}
.site-footer a:hover { color: var(--secondary-light); }
.site-footer .footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
  transition: var(--transition);
}
.site-footer .footer-link:hover { padding-left: 4px; }
.site-footer .footer-link i { font-size: 11px; color: var(--secondary); }
.site-footer .footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  margin-right: 8px;
  transition: var(--transition);
  font-size: 15px;
}
.site-footer .footer-social a:hover {
  background: var(--primary-gradient);
  color: #fff;
  transform: translateY(-2px);
}
.site-footer .footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 20px 0;
  margin-top: 40px;
  text-align: center;
  font-size: 13px;
}
.site-footer .footer-bottom a {
  color: var(--secondary-light);
  font-weight: 600;
  transition: var(--transition);
}
.site-footer .footer-bottom a:hover { color: var(--secondary-light); }

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 999;
  box-shadow: 0 4px 15px rgba(26,107,60,0.4);
  transition: var(--transition);
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(26,107,60,0.5);
  color: #fff;
}

/* Hero Section (Homepage) */
.hero-section {
  background: var(--primary-gradient);
  padding: 70px 0;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--gray-100);
  clip-path: ellipse(50% 100% at 50% 100%);
}
.hero-section .hero-title {
  color: #fff;
  font-size: 38px;
  font-weight: 800;
  text-shadow: 0 2px 15px rgba(0,0,0,0.2);
  line-height: 1.2;
}
.hero-section .hero-subtitle {
  color: rgba(255,255,255,0.85);
  font-size: 18px;
  font-weight: 400;
  max-width: 600px;
  margin: 16px auto 0;
}

@media (max-width: 768px) {
  .hero-section { padding: 50px 0; }
  .hero-section .hero-title { font-size: 26px; }
  .hero-section .hero-subtitle { font-size: 15px; }
}

/* Gallery */
.gallery-img {
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  width: 100%;
  height: 220px;
  object-fit: cover;
}
.gallery-img:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
}

/* Animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
}
@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Breadcrumb */
.breadcrumb-modern {
  background: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  margin-bottom: 20px;
}
.breadcrumb-modern .breadcrumb-item a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
.breadcrumb-modern .breadcrumb-item a:hover { color: var(--primary-dark); }
.breadcrumb-modern .breadcrumb-item.active {
  color: var(--gray-600);
}

/* Spinner */
#spinner {
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease-out, visibility 0s linear .5s;
  z-index: 99999;
}
#spinner.show {
  transition: opacity .5s ease-out, visibility 0s linear 0s;
  visibility: visible;
  opacity: 1;
}

/* Form Controls */
.form-control-modern {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px;
  transition: var(--transition);
  background: #fff;
}
.form-control-modern:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.1);
  outline: none;
}

/* Utility */
.text-gradient { background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Responsive */
@media (max-width: 576px) {
  .header-brand .institute-name { font-size: 16px; }
  .stat-card .stat-number { font-size: 30px; }
  .page-title-wrap h2 { font-size: 24px; }
  .card-modern .card-body-custom { padding: 16px; }
  .table-modern thead th, .table-modern tbody td { padding: 10px 12px; font-size: 13px; }
  .section-title-wrap h2 { font-size: 24px; }
  .counter-card-modern .counter-number { font-size: 30px; }
}
