/**
 * Lao Digital Award - Professional Light Theme
 * Optimized for Ministry of Technology and Communications (MTC)
 */

:root {
  /* Professional Color Palette */
  --bg-body: #f4f7f6;         /* Soft gray for the page background */
  --bg-surface: #ffffff;      /* Pure white for cards and header */
  --text-main: #2c3e50;       /* Dark slate for high readability */
  --text-muted: #596a7b;      /* Muted gray for secondary text */
  --color-primary: #0056b3;   /* MTC Official Blue */
  --color-primary-hover: #004494; 
  --color-accent: #f39c12;    /* Digital Award Gold/Orange */

  /* Typography */
  --font-body: 'Phetsarath OT', 'Noto Sans Lao', sans-serif;
  
  /* Borders & Shadows */
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 12px 24px rgba(0, 92, 185, 0.15);
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  padding-top: 20px;
}

/* =========================================
   Header & Navigation (Fixes Mobile Menu)
   ========================================= */
.header-banner {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 15px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  text-align: center;
}

.mtc-navbar {
  background-color: var(--bg-surface);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 30px;
}

/* Navbar Links */
.mtc-navbar .navbar-nav > li > a {
  color: var(--text-main);
  font-weight: bold;
  font-size: 15px;
  padding: 15px 20px;
  transition: color 0.3s ease;
}

.mtc-navbar .navbar-nav > li > a:hover,
.mtc-navbar .navbar-nav > .active > a {
  color: var(--color-primary);
  background-color: transparent;
}

/* Mobile Toggle Button Fix */
.mtc-navbar .navbar-toggle {
  border-color: var(--color-primary);
}
.mtc-navbar .navbar-toggle .icon-bar {
  background-color: var(--color-primary);
}
.mtc-navbar .navbar-toggle:hover {
  background-color: #e9ecef;
}

/* =========================================
   Professional Cards
   ========================================= */
.pro-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-top: 4px solid transparent;
}

.pro-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-top: 4px solid var(--color-primary);
}

.pro-card img {
  max-height: 120px;
  width: auto;
  margin-bottom: 15px;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.pro-card h4 {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-main);
  margin-bottom: 15px;
  line-height: 1.4;
}

/* =========================================
   Buttons
   ========================================= */
.btn-pro {
  background-color: var(--color-primary);
  color: #ffffff;
  border-radius: 50px; /* Pill shape */
  padding: 8px 24px;
  font-size: 14px;
  font-weight: bold;
  border: none;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-pro:hover {
  background-color: var(--color-primary-hover);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 86, 179, 0.3);
  text-decoration: none;
}

.btn-accent {
  background-color: var(--color-accent);
}
.btn-accent:hover {
  background-color: #d68910;
  box-shadow: 0 4px 10px rgba(243, 156, 18, 0.3);
}

/* =========================================
   Carousel Tweaks
   ========================================= */
.carousel-pro {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 40px;
}

/* =========================================
   Mobile Grid & Card Fixes
   ========================================= */

/* Safely apply flexbox to Bootstrap 3 rows to make cards equal height */
.mtc-card-row {
  display: flex;
  flex-wrap: wrap;
}
.mtc-card-row::before,
.mtc-card-row::after {
  display: none; /* Prevent Bootstrap pseudo-elements from breaking flexbox */
}

/* Ensure the column wrappers fill the flex space */
.mtc-card-row > [class*='col-'] {
  display: flex;
  flex-direction: column;
}

/* Make sure the card itself takes up the full width of its column */
.pro-card {
  width: 100%;
  flex-grow: 1; 
  /* (Keep your existing .pro-card styles above this) */
}

/* Force all images to be the exact same size on all screens */
.pro-card img {
  height: 110px; /* Fixed height for uniformity */
  width: 100%;
  object-fit: contain; /* Prevents stretching/distortion */
  margin-bottom: 15px;
}

/* Mobile-specific padding tweaks */
@media (max-width: 767px) {
  .pro-card {
    padding: 15px;
  }
  .pro-card h4 {
    font-size: 15px;
  }
}

/* =========================================
   Back to Top Button
   ========================================= */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  background-color: var(--color-primary);
  color: #ffffff;
  border-radius: 50%; /* Makes it a perfect circle */
  text-align: center;
  line-height: 45px; /* Vertically centers the icon */
  font-size: 18px;
  z-index: 9999; /* Ensures it stays on top of everything */
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  display: none; /* Hidden by default until the user scrolls */
  cursor: pointer;
}

.back-to-top:hover {
  background-color: var(--color-primary-hover);
  color: #ffffff;
  transform: translateY(-5px); /* Gentle lift effect on hover */
  box-shadow: var(--shadow-hover);
}