/* ===== GLOBAL STYLES ===== */
:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --body-bg:#0d6efd;
  --body-color: #212529;
  --card-bg: #ffffff;
  --border-color: #dee2e6;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

[data-theme="dark"] {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #343a40;
  --dark-color: #f8f9fa;
  --body-bg: #121212;
  --body-color: #e9ecef;
  --card-bg: #1e1e1e;
  --border-color: #495057;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--body-bg);
  color: var(--body-color);
  line-height: 1.6;
  transition: var(--transition);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  position: relative;
  margin-bottom: 1.5rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 2px;
}

.text-center .section-title::after {
  left: 50%;
  transform: translateX(-50%);
}

/* ===== BUTTONS ===== */
.btn {
  font-weight: 500;
  border-radius: 0.375rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), #0056b3);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0056b3, var(--primary-color));
}

.btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

.fade-up-text {
  animation: fadeInUp 0.8s ease-out;
}

.bi-pulse {
  animation: pulse 2s infinite;
}

.bi-bounce {
  animation: bounce 1s ease infinite;
}

.hover-animate {
  transition: var(--transition);
}

.hover-animate:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--shadow-color) !important;
}

/* ===== HERO SECTION ===== */
.hero-section {
  position: relative;
  height: 80vh;
  min-height: 600px;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* updated: soft black overlay for better readability (requested) */
  background: rgba(0,0,0,0.4);
  z-index: 1;
}

.hero-video,
.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-item {
  height: 80vh;
  min-height: 600px;
}

.carousel-control-prev,
.carousel-control-next {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 20px;
  backdrop-filter: blur(10px);
}

.carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 5px;
}

.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 100%;
  max-width: 800px;
}

.hero-content h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content .lead {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* ===== WELCOME SECTION ===== */
.welcome-section {
  background: linear-gradient(135deg, var(--light-color) 0%, #e9ecef 100%);
}

.welcome-content {
  padding: 2rem 0;
}

.welcome-image img {
  max-height: 400px;
  width: 100%;
  object-fit: cover;
}

/* ===== MAIN CONTENT LAYOUT ===== */
.main-content-container {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  position: relative;
}

.sticky-sidebar-container {
  flex: 0 0 350px;
  position: sticky;
  top: 120px;
  height: fit-content;
  z-index: 10;
  transition: all 0.3s ease;
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* ===== STICKY NOTICE SECTION ENHANCEMENTS ===== */
.sticky-sidebar {
  position: sticky;
  top: 120px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  transition: all 0.3s ease;
  z-index: 10;
}

/* When footer is approaching, disable sticky behavior */
.main-content-container.footer-approaching .sticky-sidebar {
  position: relative;
  top: auto;
}

/* Enhanced notice section styling */
.notice-section {
  background: var(--card-bg);
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px var(--shadow-color);
  padding: 1.5rem !important;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
  display: block !important;
  position: sticky;
  top: 120px;
}

.notice-board-wrapper {
  max-width: 100%;
  background: var(--card-bg);
  border-radius: 0.5rem;
  overflow: hidden;
  /* updated: increased height as requested */
  max-height: 800px;
}

.notice-item {
  border: none;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem;
  transition: var(--transition);
  background: var(--card-bg);
  text-decoration: none;
  display: block;
}

.notice-item:last-child {
  border-bottom: none;
}

.notice-item:hover {
  background: var(--light-color);
  transform: translateX(5px);
  text-decoration: none;
}

.notice-date {
  font-size: 0.875rem;
  color: var(--secondary-color);
  font-weight: 500;
}

.notice-title {
  font-weight: 600;
  color: var(--body-color);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.notice-category {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  background: var(--primary-color);
  color: white;
  font-weight: 500;
}

/* ===== DEPARTMENT CARDS ===== */
.department-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1.5rem !important;
  min-height: 280px;
}

.department-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.department-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--body-color);
  line-height: 1.3;
}

.department-card p {
  color: var(--secondary-color);
  font-size: 0.9rem;
  line-height: 1.5;
  flex-grow: 1;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== FEATURE CARDS ===== */
.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  padding: 1.5rem !important;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  color: var(--body-color);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  flex-grow: 1;
}

/* ===== PRINCIPAL SECTION ===== */
.principal-section {
  background: linear-gradient(135deg, var(--light-color) 0%, #e9ecef 100%);
}

.principal-image img {
  max-height: 400px;
  width: auto;
  object-fit: cover;
}

.principal-name {
  color: var(--primary-color);
}

.principal-content {
  padding-left: 1rem;
}

.principal-content .lead {
  color: var(--primary-color);
  font-weight: 500;
}

/* ===== TESTIMONIAL CARDS ===== */
.testimonial-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  height: 100%;
  padding: 1.5rem !important;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.testimonial-content {
  flex-grow: 1;
  margin-bottom: 1rem;
}

.testimonial-content p {
  font-style: italic;
  color: var(--body-color);
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.testimonial-author {
  margin-top: auto;
}

.testimonial-author img {
  width: 50px;
  height: 50px;
  object-fit: cover;
}

.testimonial-author-info h5 {
  color: var(--primary-color);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.testimonial-author-info p {
  font-size: 0.8rem;
  color: var(--secondary-color);
  margin-bottom: 0;
  line-height: 1.4;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1199.98px) {
  .sticky-sidebar-container {
    flex: 0 0 300px;
  }
  
  .department-card {
    min-height: 260px;
    padding: 1.25rem !important;
  }
  
  .feature-card {
    min-height: 180px;
    padding: 1.25rem !important;
  }
  
  .testimonial-card {
    min-height: 200px;
    padding: 1.25rem !important;
  }
}

@media (max-width: 991.98px) {
  .main-content-container {
    flex-direction: column;
  }
  
  .sticky-sidebar-container {
    position: static;
    flex: none;
    width: 100%;
    margin-bottom: 2rem;
  }
  
  .sticky-sidebar {
    position: static;
    max-height: none;
  }
  
  .main-content-container.footer-approaching .sticky-sidebar {
    position: static;
  }
  
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .department-card,
  .feature-card,
  .testimonial-card {
    min-height: auto;
    height: auto;
  }
}

@media (max-width: 767.98px) {
  .hero-section {
    height: 60vh;
    min-height: 400px;
  }
  
  .carousel-item {
    height: 60vh;
    min-height: 400px;
  }
  
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .hero-content .lead {
    font-size: 1rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .principal-content {
    padding-left: 0;
    margin-top: 1.5rem;
  }
  
  .department-card {
    padding: 1rem !important;
    min-height: 220px;
  }
  
  .feature-card {
    padding: 1rem !important;
    min-height: 160px;
  }
  
  .testimonial-card {
    padding: 1rem !important;
    min-height: 180px;
  }
  
  .department-icon {
    font-size: 2rem;
  }
  
  .feature-icon {
    font-size: 1.75rem;
  }
}

@media (max-width: 575.98px) {
  .hero-section {
    height: 50vh;
    min-height: 350px;
  }
  
  .carousel-item {
    height: 50vh;
    min-height: 350px;
  }
  
  .hero-content h1 {
    font-size: 1.75rem;
  }
  
  .btn-lg {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

/* ===== DARK MODE SUPPORT ===== */
[data-theme="dark"] .welcome-section,
[data-theme="dark"] .principal-section {
  background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
}

[data-theme="dark"] .department-card,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .testimonial-card {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .notice-board-wrapper {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .notice-item:hover {
  background: #2d3748;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
.btn:focus,
.nav-link:focus,
.dropdown-item:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #0000ff;
    --secondary-color: #000000;
    --body-bg: #ffffff;
    --body-color: #000000;
    --border-color: #000000;
  }
}

/* Print styles */
@media print {
  .hero-section,
  .back-to-top,
  .footer-section {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .section-title {
    color: black;
  }
}

/* Ensure proper spacing in the main content area */
.main-content {
  flex: 1;
  min-width: 0;
}

/* Ensure the sticky sidebar doesn't overlap with header */
@media (min-width: 992px) {
  body {
    padding-top: 135px; /* Account for fixed header */
  }
}

/* Smooth transitions for sticky behavior */
.sticky-sidebar {
  transition: top 0.3s ease, position 0.3s ease;
}

/* Ensure proper header spacing for sticky elements */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--body-bg);
  transition: all 0.3s ease;
}

/* Loading state for notices */
.notice-loading {
  text-align: center;
  padding: 2rem;
  color: var(--secondary-color);
  display: block;
}

.notice-loading .spinner-border {
  width: 2rem;
  height: 2rem;
  margin-bottom: 1rem;
}

/* Empty state for notices */
.notice-empty {
  text-align: center;
  padding: 2rem;
  color: var(--secondary-color);
  display: block;
}

.notice-empty .bi {
  font-size: 2rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}
/* ... (existing styles above) ... */

/* ===== FOOTER ===== */
.footer-section {
    width: 100%;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    padding: 3rem 0 0;
    margin-top: 3rem;
    position: relative;
}

.footer-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 0 2rem;
}

.footer-brand img {
    max-height: 60px;
    margin-bottom: 1rem;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.footer-links h5,
.footer-contact h5,
.footer-social h5 {
    color: white;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
}

.footer-links a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-contact p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.footer-contact i {
    margin-right: 10px;
    width: 20px;
}

.footer-social-links {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

.footer-social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
}

.footer-social-links a:hover {
    background: white;
    color: #0d6efd;
    transform: translateY(-3px);
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    margin-top: 3rem;
    padding: 1.5rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* Responsive Footer */
@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 576px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-contact p {
        justify-content: center;
    }
}