/*
 * WiseLeaf Professional Mobile Responsive Fixes
 * Comprehensive mobile UI improvements for JAPSNP journal
 * Fixes: Header overflow, dropdown positioning, container management
 */

/* CRITICAL MOBILE HEADER FIXES - Mobile Only */
@media (max-width: 767px) {
  
  /* Only fix OJS header elements on mobile */
  .pkp_structure_head {
    overflow: hidden !important;
    padding: 15px !important;
  }
  
  .pkp_head_wrapper {
    padding: 1rem !important;
    overflow: hidden !important;
  }
  
  /* TARGET ACTUAL HTML STRUCTURE: header-brand and brand-link */
  body .header-main .header-container .header-brand .brand-link {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 8px !important;
    height: auto !important;
    min-height: 70px !important;
    overflow: visible !important;
    width: 100% !important;
    padding: 10px !important;
    text-decoration: none !important;
  }
  
  /* LOGO: Target actual journal-logo class */
  body .header-main .journal-logo {
    order: 1 !important;
    max-width: 45px !important;
    max-height: 45px !important;
    margin: 0 auto 8px auto !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0 !important;
  }
  
  /* JOURNAL TITLE: Target actual journal-title class */
  body .header-main .journal-title {
    order: 2 !important;
    text-align: center !important;
    width: 100% !important;
    max-width: 300px !important;
    margin: 0 auto !important;
    overflow: visible !important;
  }
  
  body .header-main .journal-title h1 {
    font-size: 1.1rem !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow: visible !important;
    text-overflow: clip !important;
    display: block !important;
    text-align: center !important;
    width: 100% !important;
    margin: 0 0 6px 0 !important;
    padding: 0 5px !important;
    font-weight: 600 !important;
    color: inherit !important;
  }
  
  body .header-main .journal-acronym {
    font-size: 0.8rem !important;
    text-align: center !important;
    margin: 0 !important;
    color: inherit !important;
  }
  
  .pkp_site_name .is_img img {
    max-width: 50px !important;
    max-height: 50px !important;
  }
  
  /* Fix authentication and user navigation on mobile */
  .pkp_navigation_user_wrapper {
    width: 100% !important;
    overflow: hidden !important;
  }
  
  .pkp_navigation_user {
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .pkp_navigation_user a {
    width: 100% !important;
    padding: 12px !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }
}

/* MOBILE NAVIGATION FIXES - Very specific targeting only */
@media (max-width: 767px) {
  
  /* Only target the main site navigation when toggled on mobile */
  .pkp_site_nav_menu.is_open {
    position: relative !important;
  }
  
  /* Only fix dropdown positioning for main navigation */
  .pkp_site_nav_menu.is_open .dropdown-menu {
    position: relative !important;
    width: 100% !important;
    margin: 0 !important;
    transform: none !important;
  }
  
  /* Strong dropdown menu items text alignment fix */
  .dropdown-menu .dropdown-item,
  .dropdown-menu a,
  .dropdown-item,
  a.dropdown-item {
    text-align: center !important;
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
    padding: 12px 15px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
  }
  
  /* Fix dropdown menu positioning and centering */
  .nav-item .dropdown-menu,
  .dropdown-menu,
  ul.dropdown-menu {
    text-align: center !important;
  }
  
  .nav-item .dropdown-menu .dropdown-item,
  .dropdown-menu .dropdown-item,
  ul.dropdown-menu .dropdown-item {
    text-align: center !important;
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 auto !important;
    text-decoration: none !important;
  }
  
  /* Center dropdown menu icons and text */
  .dropdown-item i,
  a.dropdown-item i {
    margin-right: 8px !important;
    flex-shrink: 0 !important;
  }
  
  /* Mobile search section */
  .pkp_search_mobile {
    width: 100% !important;
    padding: 10px 15px !important;
  }
}

/* GLOBAL MOBILE CONTAINER FIXES - Mobile Only */
@media (max-width: 767px) {
  
  /* Mobile-specific container fixes only */
  body {
    overflow-x: hidden !important;
  }
  
  .pkp_structure_page {
    overflow-x: hidden !important;
  }
  
  .pkp_structure_content {
    overflow-x: hidden !important;
  }
  
  .pkp_structure_main {
    overflow-x: hidden !important;
    word-wrap: break-word !important;
  }
  
  /* Fix About page hero section on mobile - Proper content optimization */
  .page-header-enhanced {
    max-width: 100vw !important;
    width: 100vw !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    left: 50% !important;
    right: 50% !important;
    position: relative !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 25px 15px !important;
  }
  
  /* Optimize hero content for mobile readability */
  .page-header-enhanced .header-content {
    padding: 20px 15px 25px 15px !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    gap: 12px !important;
    position: relative !important;
    z-index: 2 !important;
  }
  
  /* Mobile-optimized page title */
  .page-header-enhanced .page-title,
  .page-header-enhanced h1 {
    font-size: 1.8rem !important;
    line-height: 1.2 !important;
    text-align: center !important;
    margin: 0 0 12px 0 !important;
    font-weight: 700 !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4) !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  /* Mobile-optimized title icons */
  .page-header-enhanced .page-title i {
    font-size: 2rem !important;
    margin: 0 !important;
    opacity: 1 !important;
  }
  
  /* Mobile-optimized subtitle/description */
  .page-header-enhanced .page-subtitle,
  .page-header-enhanced p {
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
    text-align: center !important;
    max-width: 95% !important;
    margin: 0 auto 20px auto !important;
    font-weight: 500 !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3) !important;
  }
  
  /* Editorial Board Statistics Grid Mobile Optimization */
  .page-header-enhanced .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto !important;
    position: relative !important;
    z-index: 2 !important;
  }
  
  /* Mobile-optimized stat cards */
  .page-header-enhanced .stat-card {
    background: rgba(12, 74, 96, 0.92) !important;
    backdrop-filter: blur(12px) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 12px !important;
    padding: 15px 10px !important;
    text-align: center !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    min-height: 110px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
  }
  
  /* Mobile stat icons */
  .page-header-enhanced .stat-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.2rem !important;
    margin: 0 auto 8px auto !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
  }
  
  /* Mobile stat numbers */
  .page-header-enhanced .stat-number {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    margin-bottom: 4px !important;
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3) !important;
  }
  
  /* Mobile stat labels */
  .page-header-enhanced .stat-label {
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2) !important;
  }
  
  /* Optimize any other icons or visual elements */
  .page-header-enhanced .fas:not(.stat-icon .fas),
  .page-header-enhanced i:not(.stat-icon i) {
    opacity: 1 !important;
  }
  
  /* Fix general content sections that overflow - avoid hero conflicts */
  .content-section:not(.page-header-enhanced),
  .article-content,
  .main-content {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  
  /* Fix general images that overflow - avoid hero conflicts */
  img:not(.page-header-enhanced img) {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Fix only problematic cards - not hero cards */
  .info-card:not(.stat-card),
  .privacy-card:not(.stat-card) {
    max-width: 100% !important;
    margin: 0 0 20px 0 !important;
    width: calc(100% - 20px) !important;
  }
  
  /* Fix buttons that are positioned incorrectly - not hero elements */
  .cta-button:not(.page-header-enhanced .cta-button),
  .action-button:not(.page-header-enhanced .action-button) {
    position: static !important;
    bottom: auto !important;
    margin: 20px 0 !important;
  }
  
  /* Editorial Board Content Mobile Optimization */
  .page_editorial_masthead .editorial-content {
    padding: 0 10px !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  
  /* Editorial sections mobile optimization */
  .page_editorial_masthead .content-section {
    margin: 25px 0 !important;
    padding: 0 5px !important;
  }
  
  /* Section titles mobile optimization */
  .page_editorial_masthead .section-title {
    font-size: 1.4rem !important;
    text-align: center !important;
    margin-bottom: 20px !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  /* Hide section title after elements on mobile */
  .page_editorial_masthead .section-title::after {
    display: none !important;
  }
  
  /* Editorial grid mobile optimization */
  .page_editorial_masthead .editors-grid,
  .page_editorial_masthead .chief-editor-showcase {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    align-items: center !important;
  }
  
  /* Editor cards mobile optimization */
  .page_editorial_masthead .editor-card {
    width: 100% !important;
    max-width: 350px !important;
    padding: 15px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  
  /* Editor photos mobile optimization */
  .page_editorial_masthead .editor-photo {
    width: 80px !important;
    height: 80px !important;
    margin: 0 auto 12px auto !important;
  }
  
  /* Editor info mobile optimization */
  .page_editorial_masthead .editor-name {
    font-size: 1rem !important;
    line-height: 1.3 !important;
    margin-bottom: 6px !important;
  }
  
  .page_editorial_masthead .editor-title {
    font-size: 0.85rem !important;
    margin-bottom: 8px !important;
  }
  
  .page_editorial_masthead .editor-affiliation,
  .page_editorial_masthead .editor-location {
    font-size: 0.8rem !important;
    margin-bottom: 6px !important;
  }
  
  /* Editor bio mobile optimization */
  .page_editorial_masthead .editor-bio {
    font-size: 0.8rem !important;
    padding: 8px !important;
    margin-bottom: 12px !important;
  }
  
  /* Academic metrics mobile optimization */
  .page_editorial_masthead .academic-metrics {
    padding: 10px !important;
    margin-bottom: 12px !important;
  }
  
  /* Specializations mobile optimization */
  .page_editorial_masthead .specializations {
    gap: 6px !important;
    margin-bottom: 12px !important;
  }
  
  .page_editorial_masthead .specialization-tag {
    font-size: 0.7rem !important;
    padding: 4px 8px !important;
  }
  
  /* Professional links mobile optimization */
  .page_editorial_masthead .professional-links {
    gap: 8px !important;
    margin-top: 12px !important;
  }
  
  .page_editorial_masthead .professional-links a {
    padding: 8px 12px !important;
    font-size: 0.75rem !important;
  }
  
  /* CTA section mobile optimization */
  .page_editorial_masthead .cta-section {
    margin: 30px -10px 0 -10px !important;
    padding: 25px 20px !important;
    border-radius: 15px !important;
  }
  
  .page_editorial_masthead .cta-title {
    font-size: 1.5rem !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin-bottom: 15px !important;
  }
  
  .page_editorial_masthead .cta-buttons {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: center !important;
  }
  
  .page_editorial_masthead .btn {
    padding: 12px 20px !important;
    font-size: 0.9rem !important;
    width: 100% !important;
    max-width: 250px !important;
    text-align: center !important;
    justify-content: center !important;
  }
  
  /* Privacy Page Mobile Optimization */
  .page_privacy .privacy-summary {
    padding: 0 10px !important;
    margin: 20px 0 !important;
  }
  
  /* Privacy summary grid mobile fix */
  .page_privacy .summary-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    align-items: center !important;
  }
  
  /* Privacy summary cards mobile optimization */
  .page_privacy .summary-card {
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 !important;
    padding: 20px 15px !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
  }
  
  /* Privacy summary icons mobile optimization */
  .page_privacy .summary-icon {
    width: 60px !important;
    height: 60px !important;
    font-size: 1.5rem !important;
    margin: 0 auto 15px auto !important;
  }
  
  /* Privacy summary card titles */
  .page_privacy .summary-card h3 {
    font-size: 1.1rem !important;
    margin-bottom: 10px !important;
  }
  
  /* Privacy summary card text */
  .page_privacy .summary-card p {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
  }
  
  /* Privacy content mobile optimization */
  .page_privacy .privacy-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    padding: 0 10px !important;
  }
  
  /* Privacy main content mobile */
  .page_privacy .main-content {
    order: 1 !important;
  }
  
  /* Privacy sidebar mobile */
  .page_privacy .privacy-sidebar {
    order: 2 !important;
    padding: 0 !important;
  }
  
  /* Privacy data types grid mobile */
  .page_privacy .data-types {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
  }
  
  /* Privacy data type cards mobile */
  .page_privacy .data-type-card {
    margin: 0 !important;
    padding: 15px !important;
  }
  
  /* Privacy rights grid mobile */
  .page_privacy .rights-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    align-items: center !important;
  }
  
  .page_privacy .right-item {
    width: 100% !important;
    max-width: 300px !important;
    padding: 15px !important;
  }
  
  /* Privacy sharing policy mobile */
  .page_privacy .sharing-policy {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
  }
  
  /* Privacy purpose items mobile */
  .page_privacy .purpose-item {
    flex-direction: column !important;
    text-align: center !important;
    padding: 15px !important;
    gap: 10px !important;
  }
  
  /* Privacy measure items mobile */
  .page_privacy .measure-item {
    flex-direction: column !important;
    text-align: center !important;
    padding: 15px !important;
    gap: 10px !important;
  }
  
  /* Terms Page Mobile Optimization */
  /* Fix three floating icons to display in row on mobile */
  .page_terms .header-visual {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    order: 2 !important;
  }
  
  .page_terms .floating-icons {
    position: static !important;
    height: auto !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 15px !important;
    width: 100% !important;
    margin: 20px 0 0 0 !important;
  }
  
  .page_terms .icon-item {
    position: static !important;
    width: 50px !important;
    height: 50px !important;
    background: rgba(0, 90, 139, 0.9) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.2rem !important;
    color: white !important;
    animation: none !important;
    box-shadow: 0 3px 10px rgba(0, 90, 139, 0.4) !important;
    flex: 0 0 auto !important;
  }
  
  /* Terms page header content mobile */
  .page_terms .page-header-enhanced {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    text-align: center !important;
  }
  
  .page_terms .header-content {
    order: 1 !important;
    text-align: center !important;
  }
  
  /* Terms content wrapper mobile */
  .page_terms .content-wrapper {
    padding: 0 10px !important;
  }
  
  /* Terms responsibilities grid mobile */
  .page_terms .responsibilities-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
  }
  
  .page_terms .responsibility-card {
    margin: 0 !important;
    padding: 15px !important;
  }
  
  /* Terms prohibited grid mobile */
  .page_terms .prohibited-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
  
  .page_terms .prohibited-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px !important;
    background: rgba(231, 76, 60, 0.1) !important;
    border-radius: 8px !important;
    border-left: 4px solid #e74c3c !important;
  }
  
  /* Homepage CTA Buttons Mobile Spacing Reduction - STRONGEST SELECTORS */
  html body .call-to-action .cta-buttons,
  html body .cta-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    align-items: center !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    padding: 0 !important;
  }
  
  html body .call-to-action .cta-button,
  html body .cta-buttons .cta-button,
  html body .cta-button {
    width: 100% !important;
    max-width: 280px !important;
    padding: 12px 20px !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    text-align: center !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    border-radius: 8px !important;
  }
  
  /* Force spacing between specific CTA buttons */
  html body .call-to-action .cta-button + .cta-button,
  html body .cta-buttons .cta-button + .cta-button {
    margin-top: 8px !important;
  }
  
  /* Reduce overall call-to-action section spacing */
  html body .call-to-action {
    margin: 15px 0 !important;
    padding: 10px !important;
  }
  
  /* Override any potential theme CSS */
  html body .call-to-action .cta-button.primary,
  html body .call-to-action .cta-button.secondary {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
  }
}

/* MOBILE FORM AND INPUT FIXES */
@media (max-width: 767px) {
  
  /* Ensure all inputs are mobile-friendly */
  .pkp_form input,
  .pkp_form textarea,
  .pkp_form select,
  form input,
  form textarea,
  form select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 12px !important;
  }
  
  /* Button improvements - target OJS buttons */
  .pkp_button,
  .btn,
  button[type="submit"],
  .cmp_button {
    min-height: 44px !important;
    padding: 12px 16px !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
    box-sizing: border-box !important;
    margin-bottom: 8px !important;
  }
  
  /* Search overlay mobile fixes */
  .cmp_search,
  .pkp_search {
    padding: 20px 10px !important;
    width: 100% !important;
  }
}

/* MOBILE TYPOGRAPHY FIXES */
@media (max-width: 767px) {
  
  /* Headings */
  h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word !important;
    hyphens: auto !important;
    overflow-wrap: break-word !important;
  }
  
  /* Ensure text doesn't overflow */
  p, div, span, li {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
  }
  
  /* Links */
  a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
  
  /* Tables responsive */
  table {
    width: 100% !important;
    overflow-x: auto !important;
    display: block !important;
    white-space: nowrap !important;
    font-size: 0.9rem !important;
  }
  
  table thead,
  table tbody,
  table tr {
    display: table !important;
    width: 100% !important;
  }
}

/* MOBILE FOOTER AND BOTTOM NAVIGATION */
@media (max-width: 767px) {
  
  .pkp_structure_footer {
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px 15px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  
  /* Footer content stacking */
  .pkp_structure_footer > div {
    width: 100% !important;
    margin-bottom: 20px !important;
    box-sizing: border-box !important;
  }
  
  /* Fix any overflowing footer elements */
  .pkp_structure_footer * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* TARGETED MOBILE VIEWPORT FIXES - Mobile Only */
@media (max-width: 767px) {
  
  /* Prevent horizontal scroll only on mobile */
  html, body {
    overflow-x: hidden !important;
  }
  
  /* Targeted element fixes to prevent overflow */
  img, video, iframe, embed, object {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Pre and code blocks */
  pre, code {
    overflow-x: auto !important;
    word-wrap: break-word !important;
  }
}

/* MOBILE ACCESSIBILITY IMPROVEMENTS */
@media (max-width: 767px) {
  
  /* Larger touch targets */
  a, button, input, select, textarea {
    min-height: 44px !important;
    min-width: 44px !important;
  }
  
  /* Better spacing for touch */
  .nav-link,
  .dropdown-item,
  .auth-btn {
    padding: 12px 15px !important;
    margin: 2px 0 !important;
  }
  
  /* Focus visibility */
  a:focus,
  button:focus,
  input:focus,
  select:focus,
  textarea:focus {
    outline: 2px solid #007cba !important;
    outline-offset: 2px !important;
  }
}

/* SPECIAL MOBILE LANDSCAPE FIXES */
@media (max-width: 767px) and (orientation: landscape) {
  
  /* Reduce header height in landscape */
  .header-main {
    padding: 8px 0 !important;
  }
  
  .header-container {
    gap: 10px !important;
  }
  
  .auth-btn {
    padding: 8px 12px !important;
    min-height: 36px !important;
    font-size: 0.85rem !important;
  }
  
  .nav-link {
    padding: 10px 15px !important;
  }
}

/* MOBILE LOADING AND PERFORMANCE */
@media (max-width: 767px) {
  
  /* Reduce animations on mobile to improve performance */
  * {
    animation-duration: 0.3s !important;
    transition-duration: 0.3s !important;
  }
  
  /* Optimize images for mobile */
  img {
    image-rendering: optimizeQuality !important;
  }
  
  /* Smooth scrolling */
  html {
    scroll-behavior: smooth !important;
  }
}

/* TARGETED FIXES FOR SPECIFIC ELEMENTS - Mobile Only */
@media (max-width: 767px) {
  
  /* Target actual About dropdown structure from HTML */
  #aboutDropdown,
  .dropdown-menu.active {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
    min-width: 200px !important;
    max-width: 90vw !important;
    z-index: 1000 !important;
    margin-right: 10px !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }
  
  /* Ensure dropdown stays within viewport on mobile */
  .wiseleaf-navigation .dropdown-menu,
  .nav-item .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
    min-width: 180px !important;
    max-width: 85vw !important;
    z-index: 1000 !important;
    margin-right: 15px !important;
    white-space: nowrap !important;
    text-align: center !important;
  }
  
  /* Specific About dropdown items centering - STRONGEST RULES */
  body .wiseleaf-navigation #aboutDropdown .dropdown-item,
  body .wiseleaf-navigation .dropdown-menu.active .dropdown-item,
  body .wiseleaf-navigation .dropdown-menu .dropdown-item,
  body .nav-item .dropdown-menu .dropdown-item,
  body .dropdown-menu .dropdown-item,
  body a.dropdown-item {
    text-align: center !important;
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
    padding: 10px 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    margin: 0 auto !important;
    position: relative !important;
  }
  
  /* FORCE center alignment for dropdown text */
  body .wiseleaf-navigation .dropdown-item span,
  body .dropdown-item span,
  body .dropdown-item {
    text-align: center !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }
  
  /* Center icons within dropdown items */
  body .wiseleaf-navigation #aboutDropdown .dropdown-item i,
  body .wiseleaf-navigation .dropdown-menu.active .dropdown-item i,
  body .wiseleaf-navigation .dropdown-menu .dropdown-item i,
  body .dropdown-item i {
    margin-right: 6px !important;
    flex-shrink: 0 !important;
    order: -1 !important;
  }
  
  /* Remove any left/right text alignment */
  body .dropdown-menu {
    text-align: center !important;
  }
  
  body .dropdown-menu li,
  body .dropdown-menu li a {
    text-align: center !important;
    justify-content: center !important;
  }
  
  /* ULTIMATE OVERRIDE for dropdown items - highest specificity */
  html body .wiseleaf-navigation .dropdown-menu .dropdown-item,
  html body .nav-item .dropdown-menu .dropdown-item,
  html body .dropdown-menu .dropdown-item,
  html body a.dropdown-item {
    justify-content: center !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Force override gap and positioning */
  html body .dropdown-menu .dropdown-item {
    gap: 8px !important;
    justify-content: center !important;
  }
  
  /* Override any Bootstrap or framework styles */
  .dropdown-menu .dropdown-item[style*="text-align"] {
    text-align: center !important;
  }
  
  /* Ensure journal title never overflows on mobile */
  .journal-title h1 {
    font-size: 1.1rem !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-wrap: break-word !important;
    line-height: 1.3 !important;
  }
}