* {
  box-sizing: border-box;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #003366;
  color: white;
  font-family: century gothic;
  text-align: center;
  padding: 20px;
  font-size: 18px;
  z-index: 1000; 
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.9);
  transition: all 0.3s ease-in-out;
}

header a {
  text-decoration: none;
}

/* Shrinking effect when scrolling */
header.shrink {
  padding: 10px;
  font-size: 14px;
}

/* Hide subtext when scrolling */
header.shrink #subtext {
  display: none;
}

a {
  text-decoration: none;
  display: inline-block;
  padding: 8px 16px;
}

a:hover {
  background-color: #ddd;
  color: black;
}

.round {
  position: absolute;  
  left: 10px;  
  background-color: white;
  border-radius: 5px;
  color: black;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../pictures/bg.png'); 
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.5; 
  z-index: -1;
}

.bg-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; 
  z-index: -1;
}

/* Accessibility Button & Container */
.accessibility-container {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
}

#accessibility-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

#accessibility-button img {
  width: 50px;
  height: auto;
  border-radius: 35px;
  transition: transform 0.3s ease;
}

#accessibility-button:hover img {
  transform: scale(1.1);
}

/* Dropdown Menu */
.accessibility-menu {
  display: none;
  position: absolute;
  left: 60px; 
  top: 0;
  background: #ffffff;
  font-family: century gothic;
  border-radius: 8px;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.3);
  padding: 10px;
  width: 200px;
}

.menu-title {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 8px;
  color: #333;
}

/* Styling buttons */
.accessibility-menu button {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  border-radius: 5px;
  transition: 0.3s;
}

.accessibility-menu button:hover {
  background: #007bff;
  color: white;
}

/* Dark mode styles */
.dark-mode {
  background-color: black !important; 
  color: white !important;          
}

/* Ensure images are not affected by dark mode */
.dark-mode img {
  filter: none !important; 
}

/* Apply to all elements inside dark mode to make them black */
.dark-mode * {
  background-color: black !important;
  color: white !important;           
  border-color: white !important;      
}

/* Make buttons visible in dark mode */
.dark-mode button {
  background-color: black !important;
  color: white !important;
  border: 1px solid white;
}

/* Make links visible in dark mode */
.dark-mode a {
  color: #00bfff !important;
}

/* Make input fields visible in dark mode */
.dark-mode input, .dark-mode textarea, .dark-mode select {
  background-color: black !important;
  color: white !important;
  border: 1px solid white;
}

/* Accessibility dropdown remains black but text is visible */
.dark-mode .accessibility-dropdown {
  background-color: black !important;
  color: white !important;
  border: 1px solid white;
}

.chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 125px;
  font-family: century gothic;
}

.level {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.box {
  border: 2px solid #103280;
  background-color: #f4f4f4;
  padding: 15px;
  margin: 10px;
  border-radius: 8px;
  font-weight: bold;
  width: 180px;
  margin-top: 3px;
  margin-bottom: 3px;
  text-align: center;
}

.line {
  width: 5px;
  height: 20px;
  background-color: black;
  margin: auto;
  margin-top: 5px;
  margin-bottom: 5px;
}

.department {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; 
  padding: 10px;
  border-radius: 8px;
  width: fit-content;
  min-width: 250px;
  height: auto; 
  align-self: flex-start; 
}

.sub-box img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover; 
  display: block;
  margin: 0 auto;
}

.box img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-bottom: 10px;
}

.name {
  font-weight: bold;
  margin: 5px 0;
  text-align: center;
}

.position {
  font-size: 0.9em;
  color: #555;
  text-align: center;
}

.sales-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 200px;
}

.full-width {
  text-align: center;
  margin-bottom: 10px;
}

.grid-container {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.grid-item {
  text-align: center;
  width: 50%;
  background-color: #f4f4f4;
  border-radius: 5px;
  padding: 5px;
}

.grid-item img, .full-width img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  background-color: #f4f4f4;
}

.dropdown-btn {
  display: block;
  margin: 20px auto;
  background-color: #103280;
  color: white;
  border: none;
  padding: 8px;
  cursor: pointer;
  font-size: 14px;
  border-radius: 5px;
  margin-top: 5px;
}

.dropdown-btn:hover {
  background-color: #0c265c;
}

.staff-list {
  display: none;
  align-items: center; 
  justify-content: center;  
  text-align:center;
  margin: 0 auto; 
  width: 80%;
  max-width: 600px;
}

.sub-box {
  padding: 5px;
  background-color: #f4f4f4;
  border-radius: 5px;
  margin: 5px 0;
  align-items: center;

}

/* Ensure staff list is centered */
#pqpStaff, #logiStaff, #salesStaff {
  display: none;  
  margin: 0 auto;
  width: 80%;
  max-width: 600px; 
  text-align: center; 
}

.dropdown-btn {
  display: block;
  margin: 20px auto; 
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px; 
  background-color: #103280;
}

.icon {
  display: inline-block; 
  transition: transform 0.3s ease;
}

/* Fix: This ensures the icon flips correctly */
.flipped {
  transform: rotate(180deg); 
}

/* Optional: If you want to add some spacing between elements */
.sub-box {
  margin-bottom: 10px;
}

/* Hover effect for the department boxes */
.department:hover {
  background-color: #bce0f3; 
  transform: scale(1.05); 
  transition: transform 0.3s, background-color 0.3s;
}

/* Hover effect for the main box (e.g., President, Director) */
.box:hover {
  transform: scale(1.05);
  transition: transform 0.3s, background-color 0.3s;
}

/* Hover effect for sub-boxes (individual staff) */
.sub-box:hover {
  background-color: #f0f8ff;
  cursor: pointer; 
  transform: scale(1.05); 
  transition: transform 0.3s, background-color 0.3s;
}

/* Hover effect for the dropdown button */
.dropdown-btn:hover {
  background-color: #0a1d49;
  transition: background-color 0.3s;
}

/* Hover effect for grid items (Sales, Accounting, etc.) */
.grid-item:hover {
  background-color: #f0f8ff; 
  transform: scale(1.05); 
  transition: transform 0.3s, background-color 0.3s, border 0.3s;
}

.footer-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  background-color: #111;
  margin-top: 50px;
  color: #fff;
}

.footer-top {
  display: flex;
  justify-content: left;
  align-items: center;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-section {
  flex: 1;
  min-width: 200px;
}

ul {
  list-style: none;
  padding: 0;
}

ul li {
  margin-bottom: 5px;
}

.footer-logo {
  width: 150px;
}

.footer-container a {
  color: #007bff !important; 
  background-color: transparent !important; 
  text-decoration: none; 
  display: inline-block; 
  margin: 0; 
  padding: 0;
}

.footer-container h3 {
  text-align: left;
}

.footer-container a:hover {
  text-decoration: underline;
  color: #0056b3 !important; 
}

.footer-copyright {
  text-align: center;
  padding: 10px;
  border-top: 1px solid #444;
  color: black;
  background-color: white;
  font-size: 14px;
}


/* Responsive Styles for Tablets and Mobile Devices */
@media (max-width: 768px) {
  header {
    font-size: 16px;
    padding: 15px;
  }

  header.shrink {
    font-size: 12px;
    padding: 8px;
  }

  .chart {
    margin-top: 100px;
  }

  .level {
    flex-direction: column;
    align-items: center;
  }

  .box {
    width: 90%;
    font-size: 14px;
  }

  .department {
    min-width: 90%;
    align-self: center;
  }

  .sales-grid {
    width: 100%;
  }

  .grid-container {
    flex-direction: column;
    gap: 20px;
  }

  .grid-item {
    width: 90%;
    margin: 0 auto;
  }

  .dropdown-btn {
    width: 90%;
    font-size: 14px;
  }

  .staff-list {
    width: 95%;
  }

  #pqpStaff, #logiStaff, #salesStaff {
    width: 95%;
  }

  .footer-container {
    gap: 15px;
  }

  .footer-container a {
    font-size: 14px;
  }

  .footer-copyright {
    font-size: 12px;
  }

  .footer-top,
  .footer-bottom {
    flex-direction: column;
    align-items: center;
  }

  .footer-section {
    width: 100%;
    text-align: center;
  }
}