/* Specific styles for all global elements (navbar, footer, fab container) */

/* Navbar Base */
#navbar-container {
  position: fixed; top: 0; left: 0; width: 100%; height: var(--header-height);
  background: var(--color-2) !important; 
  padding: 0 !important; /* Ensure children fill height */
  display: flex; align-items: center;
  z-index: 1000;
}

/* Ensure Bootstrap container and ul allow full height */
#navbar-container .container, 
#navbar-container .collapse, 
#navbar-container .navbar-nav {
  height: 100%;
}

/* Navbar brand */
.brand-container {
  display: flex;
  align-items: center;
  gap: 5px; /* Space between icon and text */
  text-decoration: none;
  color: var(--white);
  height: 100%; /* Match your navbar height */
  transition: color 0.3s ease;
}

.brand-icon {
  /* Use a fixed height or percentage relative to the 64px container */
  height: 75%; 
  width: auto;
  flex-shrink: 0;
  /* Crucial: ensures the SVG uses the 'color' property for its paths */
  fill: currentColor; 
}

.brand-titles {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-text-cn {
  font-family: "SimSun", Times, serif;
  font-size: 16px;
  font-weight: bold;
  line-height: 1.5;
}

.brand-text-en {
  padding-left: 4px;
  font-family: "Times New Roman", Times, serif;
  font-size: 12px;
  font-weight: medium;
  letter-spacing: 0.8px;
  line-height: 1.2;
}

/* Hover Logic */
.brand-container:hover {
  color: var(--color-1) !important;
}

/* Nav Item Wrapper */
.nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  overflow: hidden; /* Clips the hover animation */
}

/* Link Style */
.nav-link {
  color: var(--white) !important;
  height: 100%;
  display: flex !important;
  align-items: center;
  padding: 0 20px !important;
  position: relative;
  z-index: 2; /* Sits above the hover effect */
  transition: color 0.3s ease;
}

/* Hover Effect: Expansion from Middle */
.nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 100%;
  background-color: var(--color-1);
  transition: all 0.4s ease;
  z-index: 1;
  transform: translateX(-50%);
}

.nav-item:hover::before {
  width: 100%;
}

/* Active State: Background color-1 filling the area */
.nav-item.active {
  background-color: var(--color-1) !important;
}

.nav-item.active .nav-link {
  background-color: var(--color-1) !important;
  font-weight: 700;
}

.nav-item.active::before {
  display: none; /* Disable hover animation on active items */
}

/* Footer Base */
#footer-container {
  background-color: var(--color-2);
  color: var(--white);
  padding: 30px 0;
  margin-top: auto;
  z-index: 1000;
}

#footer-container .container {
  height: 100%;
}

.footer-brand {
  height: var(--header-height); /* Match your footer height */
  align-items: center;
  justify-content: center;
}

.footer-brand:hover {
  color: var(--white) !important;
}

.footer-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.icon-circle {
  width: 45px;
  height: 45px;
  background-color: var(--white); /* White circle background */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--color-1); /* Black icon color */
  font-size: 20px;
  transition: all 0.3s ease;
}

/* Hover effect: icon turns to Brand Color 1 */
.icon-circle:hover {
  color: var(--color-2);
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.footer-link {
  color: var(--white);
  text-decoration: underline;
  font-size: 16px;
  line-height: 1.8;
  transition: color 0.3s ease;
}

.footer-contact {
  font-size: 16px;
  line-height: 1.8;
  margin-top: 10px;
}

.footer-link:hover {
  color: var(--color-1);
}

.footer-h5 {
  color: var(--white);
  margin-top: 15px;
}

/* FAB container */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 15px;
}

/* 主按鈕 */
.fab-main {
    width: 60px;
    height: 60px;
    background-color: #007bff; /* 診所主題色 */
    color: var(--white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.3s;
    font-size: 24px;
}

/* 當主按鈕點擊後旋轉 */
.fab-main.active {
    transform: rotate(45deg);
    background-color: #6c757d;
}

/* 子按鈕清單（預設隱藏） */
.fab-list {
    display: none;
    flex-direction: column-reverse;
    gap: 12px;
    animation: fadeIn 0.3s forwards;
}

.fab-list.show {
    display: flex;
}

/* 子按鈕樣式 */
.fab-item {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--white);
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.bg-messenger { background-color: #0084FF; }
.bg-line { background-color: #00B900; }
.bg-email { background-color: #EA4335; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
