html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ==========================================================================
   Custom Multi-tier Header Styling (HealthNotes Theme)
   ========================================================================== */

/* 1. TOP HEADER */
.site-header {
    background-color: #444444; /* Dark gray background */
}

.header-top {
    background-color: #444444;
    border-bottom: none;
}

.header-logo {
    display: flex;
    align-items: center;
    color: #ffffff; /* White logo text */
    font-size: 2rem;
    font-weight: 800;
}
.header-logo i {
    margin-right: 8px;
    font-size: 2.2rem;
    color: #4bc0c8; /* Example dual-color like Nam Khanh, or keep it */
}
.header-logo:hover {
    color: #eeeeee;
}

/* Search Form */
.header-search {
    width: 100%;
    max-width: 350px;
}
.search-form {
    border: none;
    border-radius: 50px;
    overflow: hidden;
    background-color: #52a356; /* Green background for search */
}
.search-input {
    border: none;
    box-shadow: none !important;
    padding-left: 20px;
    background-color: transparent;
    color: #ffffff;
}
.search-input::placeholder {
    color: rgba(255, 255, 255, 0.9);
}
.search-input:focus {
    background-color: transparent;
    color: #ffffff;
}
.search-btn {
    background-color: transparent;
    color: #fff;
    border: none;
    border-radius: 0;
    padding: 0 20px;
    transition: opacity 0.3s;
}
.search-btn:hover {
    background-color: transparent;
    opacity: 0.8;
}

/* Account Actions */
.login-btn {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    color: #333;
    font-weight: 600;
    border-radius: 50px;
    padding: 6px 20px;
}
.login-btn:hover {
    background-color: #e2e6ea;
}

/* 2. MAIN MENU */
.header-menu {
    background: linear-gradient(to bottom, #44aa54, #2a853e); /* Green gradient */
    border-bottom: 2px solid #1a5230;
}

.header-menu .navbar-nav {
    display: flex;
    width: 100%;
}

.header-menu .menu-item {
    flex-grow: 1;
    text-align: center;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}
.header-menu .menu-item:first-child {
    border-left: none;
}
.header-menu .menu-item:last-child {
    border-right: none;
}

.header-menu .nav-link {
    color: #ffffff !important;
    font-weight: 500;
    padding: 15px 10px !important;
    text-transform: uppercase;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.header-menu .nav-link:hover,
.header-menu .nav-link.active,
.header-menu .nav-item:hover > .nav-link {
    background-color: rgba(255, 255, 255, 0.15); /* Slightly lighter on active/hover */
}

/* Dropdowns */
.header-menu .dropdown-menu {
    background-color: #2a853e;
    border: none;
    border-radius: 0;
    margin-top: 0;
    padding: 0;
}

.header-menu .dropdown-item {
    color: #ffffff !important;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
}

.header-menu .dropdown-menu li:last-child .dropdown-item {
    border-bottom: none;
}

.header-menu .dropdown-item:hover,
.header-menu .dropdown-item:focus {
    background-color: #1c5f27;
    color: #ffc107 !important;
    padding-left: 25px;
}

.header-menu .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 0;
}

/* Show dropdown on hover (Desktop) */
@media all and (min-width: 992px) {
    .header-menu .nav-item.dropdown:hover .dropdown-menu {
        display: block;
        animation: fadeInMenu 0.2s ease-in-out;
    }
}

@keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   LIVE SEARCH DROPDOWN STYLES
   ========================================================================== */
.live-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    min-width: 380px;
    z-index: 1050;
    margin-top: 6px;
    max-height: 480px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.08);
}
.live-search-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none;
    color: #212529;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}
.live-search-item:hover {
    background-color: #f8f9fa;
    transform: translateX(4px);
    color: #0d6efd;
}
.live-search-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
    flex-shrink: 0;
    background-color: #e9ecef;
}
.live-search-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #6c757d;
    padding: 6px 12px;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   DARK MODE STYLES (DARK/LIGHT TOGGLE)
   ========================================================================== */
body.dark-mode {
    background-color: #121824 !important;
    color: #e2e8f0 !important;
}
body.dark-mode .bg-light,
body.dark-mode .bg-white {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}
body.dark-mode .card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}
body.dark-mode .text-dark {
    color: #f8fafc !important;
}
body.dark-mode .text-muted {
    color: #94a3b8 !important;
}
body.dark-mode .border,
body.dark-mode .border-top,
body.dark-mode .border-bottom {
    border-color: #334155 !important;
}
body.dark-mode .live-search-dropdown {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}
body.dark-mode .live-search-item {
    color: #e2e8f0 !important;
}
body.dark-mode .live-search-item:hover {
    background-color: #334155 !important;
    color: #38bdf8 !important;
}
body.dark-mode .live-search-dropdown .bg-light {
    background-color: #0f172a !important;
}
body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}