* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f8ff; /* Pearl white background */
  color: #000000;            /* Dark text */
  line-height: 1.6;
  font-size: 1.2rem;
  overflow-x: hidden;
  width: 100%;
}

/* ===== WRAPPER ===== */
.wrapper {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-x: hidden;
}

/* ===== HEADER STYLES ===== */
header {
  background: linear-gradient(135deg, #FF7E5F, #FD3A69);
  padding: 10px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  width: 100%;
  position: relative;
  z-index: 1000;
  /* CRITICAL: Allow dropdowns to show */
  overflow: visible;
}

.nav-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  /* CRITICAL: Allow dropdowns to show */
  overflow: visible !important;
}

/* ===== LOGO STYLES ===== */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.logo a {
  color: #ffffff;
  font-size: 1.3rem;
  text-decoration: none;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  font-size: 1.3rem;
}

/* ===== DESKTOP NAVIGATION MENU ===== */
.desktop-menu {
  list-style: none;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
  position: static;
  overflow: visible !important;
}

.desktop-menu > li {
  position: relative; /* CRITICAL for dropdown positioning */
  margin: 0 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
}

.desktop-menu > li:last-child {
  border-right: none;
}

.desktop-menu > li > a {
  color: #ffffff;
  text-decoration: none;
  font-size: 1rem;
  padding: 8px 12px;
  transition: background 0.3s ease;
  border-radius: 4px;
  white-space: nowrap;
  display: block;
}

.desktop-menu > li > a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* ===== DROPDOWN STYLES - CRITICAL SECTION ===== */
.desktop-menu .dropdown-content {
  /* Hide by default */
  display: none !important;
  
  /* Positioning */
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  
  /* Appearance */
  background-color: #222 !important;
  border-radius: 4px;
  min-width: 220px;
  max-width: 300px;
  
  /* Layering - Extremely high z-index */
  z-index: 999999 !important;
  
  /* Visibility */
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  
  /* Layout */
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  
  /* Shadow and border */
  box-shadow: 0 8px 16px rgba(0,0,0,0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  
  /* Prevent clipping */
  overflow: visible !important;
  transform: none !important;
}

/* CRITICAL: Show dropdown on hover - Multiple selectors for compatibility */
.desktop-menu > li:hover .dropdown-content,
.desktop-menu > li.dropdown:hover .dropdown-content,
.desktop-menu > li:hover > .dropdown-content {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Dropdown items styling */
.desktop-menu .dropdown-content li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  width: 100%;
  display: block !important;
}

.desktop-menu .dropdown-content li:last-child {
  border-bottom: none;
}

.desktop-menu .dropdown-content li a {
  display: block !important;
  padding: 12px 16px !important;
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 0.95rem !important;
  transition: background-color 0.3s ease !important;
  border: none !important;
  border-radius: 0 !important;
  white-space: nowrap;
  width: 100%;
  box-sizing: border-box;
}

.desktop-menu .dropdown-content li a:hover {
  background-color: #FF7E5F !important;
  color: #ffffff !important;
}

/* Dropdown arrow indicators */
.desktop-menu > li.dropdown > a::after {
  content: " ▼";
  font-size: 0.7rem;
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.desktop-menu > li.dropdown:hover > a::after {
  transform: rotate(180deg);
}

/* ===== MOBILE MENU TOGGLE (HAMBURGER) ===== */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 5px;
  z-index: 1002;
}

.menu-toggle .bar {
  height: 3px;
  width: 25px;
  background-color: #ffffff;
  margin: 3px 0;
  transition: 0.4s;
}

/* ===== MOBILE SIDEBAR NAVIGATION ===== */
.sidebar {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100%;
  background-color: #333;
  transition: right 0.3s ease;
  z-index: 1001;
  overflow-y: auto;
  padding-top: 60px;
}

.sidebar.active {
  right: 0;
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 1000;
}

.mobile-nav-overlay.active {
  display: block;
}

/* Mobile Menu Items */
.mobile-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.mobile-menu li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin: 0;
  text-align: left;
  padding: 10px 15px;
  width: 100%;
  box-sizing: border-box;
}

.mobile-menu li a {
  font-size: 1.1rem;
  color: #ffffff;
  text-decoration: none;
  display: block;
  width: 100%;
}

/* Mobile Dropdown in Sidebar */
.mobile-menu li .dropdown-content {
  display: none;
  list-style: none;
  padding: 0;
  margin: 5px 0 0 0;
  background-color: #444;
  width: 100%;
}

.mobile-menu li.active .dropdown-content {
  display: block;
}

.mobile-menu li .dropdown-content li {
  padding-left: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-menu li .dropdown-content li a {
  padding: 8px 12px;
  font-size: 1rem;
}

/* ===== MAIN CONTENT ===== */
main {
  flex: 1;
  max-width: 100%;
  margin: 10px auto;
  padding: 15px;
  background-color: #f8f8ff;
  color: #000000;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

main section {
  margin-bottom: 30px;
  opacity: 0;
  animation: fadeInUp 1s forwards;
  width: 100%;
  box-sizing: border-box;
}

main section:nth-child(1) { animation-delay: 0.3s; }
main section:nth-child(2) { animation-delay: 0.6s; }
main section:nth-child(3) { animation-delay: 0.9s; }

main p {
  animation: fadeIn 1.2s ease-in-out both;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== FOOTER STYLES ===== */
footer {
  background-color: #1e1e1e;
  color: #cccccc;
  font-size: 0.9rem;
  width: 100%;
  overflow-x: hidden;
}

.footer-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 15px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  box-sizing: border-box;
  gap: 10px;
}

.footer-left { 
  text-align: left;
  flex: 1;
  min-width: 0;
}

.footer-right { 
  text-align: right;
  flex-shrink: 0;
}

.footer-center {
  flex-wrap: wrap;
  gap: 0.5rem;
}

footer ul.social-media {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

footer ul.social-media li {
  margin: 0;
}

footer ul.social-media li a {
  color: #cccccc;
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 0.85rem;
}

footer ul.social-media li a:hover {
  color: #ffffff;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Mobile devices (up to 768px) */
@media (max-width: 768px) {
  .desktop-menu {
    display: none !important;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .nav-container {
    padding: 0 8px;
  }
  
  .logo a {
    font-size: 1.1rem;
  }
  
  .logo img {
    height: 28px;
  }
  
  main {
    margin: 5px auto;
    padding: 10px;
    border-radius: 0;
  }
  
  .footer-container {
    flex-direction: column;
    text-align: center;
    padding: 10px;
    gap: 8px;
  }
  
  .footer-left,
  .footer-right {
    text-align: center;
  }
  
  .footer-left p,
  .footer-left span {
    font-size: 0.8rem;
  }
  
  footer ul.social-media {
    justify-content: center;
  }
  
  /* Hide dropdown arrows on mobile */
  .desktop-menu > li.dropdown > a::after {
    display: none;
  }
}

/* Extra small screens (up to 480px) */
@media (max-width: 480px) {
  .nav-container {
    padding: 0 5px;
  }
  
  .logo a {
    font-size: 1rem;
    gap: 0.25rem;
  }
  
  .logo img {
    height: 24px;
  }
  
  main {
    margin: 0;
    padding: 8px;
    border-radius: 0;
  }
  
  .sidebar {
    width: 260px;
  }
  
  .mobile-menu li {
    padding: 8px 12px;
  }
  
  .mobile-menu li a {
    font-size: 1rem;
  }
  
  .footer-container {
    padding: 8px 5px;
  }
}

/* Tablet and larger screens (769px and up) */
@media (min-width: 769px) {
  .sidebar, 
  .mobile-nav-overlay {
    display: none !important;
  }
  
  .nav-container {
    padding: 0 15px;
  }
  
  .logo a {
    font-size: 1.5rem;
  }
  
  .logo img {
    height: 36px;
  }
  
  .desktop-menu {
    display: flex !important;
  }
  
  .desktop-menu > li {
    margin: 0 12px;
  }
  
  .desktop-menu > li > a {
    font-size: 1.1rem;
    padding: 8px 10px;
  }
  
  main {
    margin: 15px auto;
    padding: 18px;
  }
}

/* Large screens (1024px and up) - Dropdown positioning fixes */
@media (min-width: 1024px) {
  .desktop-menu .dropdown-content {
    min-width: 240px;
  }
  
  .desktop-menu > li:nth-last-child(1) .dropdown-content,
  .desktop-menu > li:nth-last-child(2) .dropdown-content {
    right: 0;
    left: auto;
  }
}

/* Very large screens (1200px and up) */
@media (min-width: 1200px) {
  .nav-container {
    padding: 0 20px;
  }
  
  .desktop-menu > li {
    margin: 0 15px;
  }
  
  .desktop-menu > li > a {
    font-size: 1.2rem;
    padding: 10px 12px;
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
/* Focus styles for better keyboard navigation */
*:focus {
  outline: 2px solid #FF7E5F;
  outline-offset: 2px;
}

/* Skip link styles */
.skip-to-main {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 1em;
  background-color: #FF7E5F;
  color: white;
  text-decoration: none;
}

.skip-to-main:focus {
  left: 50%;
  transform: translateX(-50%);
  top: 10px;
  border-radius: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .desktop-menu .dropdown-content {
    border: 2px solid #ffffff !important;
  }
  
  .desktop-menu .dropdown-content li a:hover {
    background-color: #ffffff !important;
    color: #000000 !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .desktop-menu > li.dropdown > a::after {
    transition: none;
  }
}
