/* Responsive CSS for Mobile Navigation */

/* Mobile styles */
@media (max-width: 767px) {
  /* Header and navbar structure */
  /* Restructure navbar header to allow for landing notice display */
  .navbar-header {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0 10px;
    min-height: 90px !important; /* Increased to accommodate larger logo */
    padding-top: 5px !important;
  }

  /* Adjust logo - ENLARGED */
  #participate-logo {
    max-width: 200px !important; /* Increased from 160px */
    height: auto;
    margin: 8px auto 5px !important; /* Adjusted margins */
    display: block;
    max-height: 80px !important; /* Increased from 28px */
  }

  /* Position hamburger menu */
  .navbar-toggle {
    position: absolute;
    top: 10px !important; /* Moved down to align with larger logo */
    right: 15px !important;
    z-index: 1020;
    padding: 5px 7px !important; /* Smaller padding */
    margin: 0 !important;
  }
  
  /* Landing notice styling */
  #landing-notice {
    display: block !important;
    width: 100%;
    text-align: center;
    padding: 2px 10px !important; /* Reduced padding */
    margin-top: 5px !important; /* Adjusted for larger logo */
    margin-bottom: 2px !important; /* Reduced margin */
    clear: both;
    font-size: 12px !important; /* Smaller font */
    border-radius: 4px;
    order: 1;
    line-height: 1.2 !important; /* Tighter line height */
  }
  
  /* Hide extra hamburger menu */
  .navbar-toggle[style*="right: 15px"] {
    display: none !important;
  }
  
  /* Single visible hamburger menu */
  .navbar-header .navbar-toggle {
    display: block;
    position: absolute;
    top: 10px !important; /* Match the top position above */
    right: 15px !important;
    z-index: 1020;
  }
  
  /* Container positioning */
  .navbar > .container {
    position: relative;
    width: 100%;
    padding: 0 !important; /* Remove padding */
  }
  
  /* Hamburger icon bars */
  .navbar-toggle .icon-bar {
    display: block;
    width: 20px; /* Slightly smaller */
    height: 2px;
    border-radius: 1px;
    background-color: #333;
    margin: 3px 0; /* Tighter spacing */
  }
  
  /* Collapsing navbar */
  .navbar-collapse.collapse {
    display: none !important;
    height: auto !important;
    padding-bottom: 0;
    overflow: hidden !important;
  }
  
  .navbar-collapse.collapse.in {
    display: block !important;
    overflow-y: auto !important;
    max-height: calc(100vh - 160px); /* Adjusted height for larger header */
    padding-top: 5px; /* Reduced padding */
  }
  
  /* Main navigation */
  .navbar-nav {
    float: none !important;
    margin: 0 !important;
    width: 100% !important;
  }
  
  .navbar-nav > li {
    float: none !important;
    display: block !important;
    width: 100% !important;
  }
  
  .navbar-nav > li > a {
    padding: 8px 15px !important; /* Reduced padding */
    border-bottom: 1px solid #eee !important;
  }
  
  /* Position caret icon to the right */
  .navbar-nav > li > a > i.fa-caret-down {
    float: right;
    margin-top: 2px; /* Adjusted positioning */
  }
  
  /* Dropdown styling */
  .dropdown-menu {
    position: static !important;
    float: none !important;
    width: 100% !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: #f8f8f8 !important;
    display: none;
  }
  
  .dropdown-menu > li > a {
    padding: 6px 25px !important; /* Reduced padding */
    border-bottom: 1px solid #f5f5f5 !important;
  }
  
  /* Display dropdowns when opened */
  .navbar-nav > li.open > .dropdown-menu {
    display: block !important;
  }
  
  /* Submenu styling */
  .dropdown-submenu {
    position: relative;
  }
  
  .dropdown-submenu > a:after {
    display: block;
    content: " ";
    float: right;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
    border-width: 4px 0 4px 4px; /* Smaller arrow */
    border-left-color: #333;
    margin-top: 4px;
    margin-right: -5px; /* Less spacing */
  }
  
  .dropdown-submenu > .dropdown-menu {
    display: none;
    position: static;
    margin-left: 10px !important; /* Less indentation */
    border-radius: 0;
  }
  
  .dropdown-submenu.open > .dropdown-menu {
    display: block !important;
  }
  
  /* Profile dropdown styling */
  .setting-dropdown-menu {
    position: relative;
    z-index: 1010 !important;
    padding-bottom: 15px !important; 
  }
  
  /* Change profile dropdown behavior */
  .setting-dropdown-menu.open .profile-dropdown {
    display: block !important;
    position: static !important; /* Change from absolute to static */
    width: 100% !important; /* Full width */
    max-width: 100% !important;
    max-height: none !important;
    background-color: #f5f5f5 !important; /* Slightly different background to distinguish */
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 30px !important;
  }
  
  /* Keep menu button visible when dropdown is open */
  .setting-dropdown-menu.open .user-profile-menu {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    margin-bottom: 0 !important;
    border-bottom: none !important;
  }
  /* Fix profile dropdown visibility */
  .setting-dropdown-menu .profile-dropdown {
    display: none !important; /* Hidden by default */
  }
  
  /* Only show when parent has open class */
  .setting-dropdown-menu.open .profile-dropdown {
    display: block !important;
  }
  
  /* Ensure proper z-index and positioning */
  .setting-dropdown-menu .profile-dropdown {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    z-index: 9999 !important;
    width: 100% !important;
    max-width: 250px !important;
    background-color: #fff !important;
    border: 1px solid rgba(0,0,0,.15) !important;
    border-radius: 4px !important;
    box-shadow: 0 6px 12px rgba(0,0,0,.175) !important;
  }
  
  /* Adjust the profile button to maintain active state when open */
  .setting-dropdown-menu.open .user-profile-menu {
    background-color: #e6e6e6 !important;
    border-color: #adadad !important;
  }
  /* Style profile dropdown items as a list */
  .profile-dropdown li a {
    padding: 8px 15px !important;
    border-bottom: 1px solid #e5e5e5 !important;
    font-size: 13px !important;
  }
  
  /* Adjust notification count position for list style */
  .profile-dropdown .with-count .count {
    right: 15px !important;
  }
  
  /* Make dividers more subtle in list style */
  .profile-dropdown .divider {
    display: none !important; /* Hide dividers as we now have borders */
  }
  
  /* Adjust container for the profile section */
  .top-action-btns {
    margin-bottom: 0 !important; /* Remove margin as menu is now inline */
  }
  
  /* Style the profile button to look more like a section header */
  .user-profile-menu {
    border-radius: 0 !important;
    background-color: #eaeaea !important; /* Slightly darker to appear as header */
    border: none !important;
    border-bottom: 1px solid #ddd !important;
    width: 100% !important;
    text-align: left !important;
    padding: 5px 10px !important; /* Reduced padding */
    z-index: 1010 !important;
  }
  
  /* Hide dropdown caret since it's not dropping down anymore */
  .user-profile-menu .fa-caret-down {
    display: none !important;
  }
  
  /* Ensure the profile section behaves properly in the flex layout */
  #main-public-nav-collapse .navbar-right.top-action-btns {
    order: 2 !important;
    width: 100% !important;
    padding-top: 10px !important; /* Adjusted for larger logo */
  }

  /* Parent container positioning */
  .navbar-right .top-action-btns {
    position: static !important;
  }
  
  /* Profile dropdown positioning */
  .top-action-btns {
    position: relative !important;
    z-index: 1010 !important;
    margin-bottom: 25px !important; /* Reduced margin */
  }
  
  /* Notification count */
  #span_user_total_unread {
    position: absolute !important;
    top: 5px !important; /* Higher position */
    right: 5px !important; /* Closer to edge */
    font-size: 9px !important; /* Smaller font */
    min-width: 14px !important; /* Smaller size */
    height: 14px !important;
    line-height: 14px !important;
    padding: 0 3px !important;
  }
  
  /* Search form */
  .navbar-form.navbar-right {
    margin: 0 !important;
    padding: 5px 10px !important; /* Reduced padding */
    border-top: 1px solid #e7e7e7 !important;
    border-bottom: 1px solid #e7e7e7 !important;
    box-shadow: none !important;
    width: 100% !important;
    clear: both !important;
    position: relative !important;
    z-index: 5 !important;
    order: 100 !important;
    margin-top: 0 !important; /* No extra space */
  }
  
  /* Flex ordering */
  #main-public-nav-collapse {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    padding: 0 !important;
  }
  
  #main-public-nav-collapse .navbar-nav.main-public-nav {
    order: 1 !important;
  }
  
  #main-public-nav-collapse .navbar-right.top-action-btns {
    order: 2 !important;
  }
  
  #main-public-nav-collapse .navbar-form.navbar-right {
    order: 3 !important;
  }
  
  /* Search input */
  .navbar-form .form-group {
    display: flex !important;
    width: 100% !important;
    margin-bottom: 0 !important; /* Fixed excessive spacing */
  }
  
  .navbar-form .input-text {
    flex: 1 !important;
    width: 100% !important;
    height: 30px !important; /* Smaller height */
    padding: 3px 10px !important; /* Less padding */
    border: 1px solid #ccc !important;
    border-radius: 4px 0 0 4px !important;
  }
  
  .navbar-form .button {
    height: 30px !important; /* Smaller height */
    padding: 3px 10px !important; /* Less padding */
    background-color: #f5f5f5 !important;
    border: 1px solid #ccc !important;
    border-left: none !important;
    border-radius: 0 4px 4px 0 !important;
  }
  
  /* Navigation order */
  .navbar-nav {
    order: 1 !important;
  }
  
  .navbar-nav.navbar-right, .navbar-right {
    order: 2 !important;
  }
  
  .navbar-form {
    order: 3 !important;
  }
  
  /* Bottom navigation tabs */
  .nav-tabs {
    border-bottom: 1px solid #ddd;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .nav-tabs > li {
    float: none;
    flex: 0 0 auto;
  }
  
  /* Notification counts */
  .count {
    display: inline-block !important;
    min-width: 16px !important; /* Smaller */
    height: 16px !important; /* Smaller */
    padding: 0 4px !important; /* Less padding */
    font-size: 10px !important; /* Smaller font */
    font-weight: bold !important;
    line-height: 16px !important;
    color: #fff !important;
    text-align: center !important;
    background-color: #f44336 !important;
    border-radius: 8px !important;
  }
  
  .with-count .count {
    position: absolute !important;
    right: 10px !important; /* Closer to edge */
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
  
  /* Profile name truncation */
  .profile-pic-name {
    max-width: 85% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  
  .profile-pic-name span {
    max-width: 110px !important; /* Slightly narrower */
    display: inline-block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    font-size: 13px !important; /* Smaller font */
  }
  
  /* Bottom nav */
  .bottom-nav {
    display: flex;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #ddd;
    padding: 5px 0; /* Reduced padding */
    z-index: 1000;
  }
  
  .bottom-nav a {
    flex: 1;
    text-align: center;
    padding: 3px; /* Less padding */
    color: #666;
    text-decoration: none;
    font-size: 12px !important; /* Smaller font */
  }
  
  /* Bottom space for fixed navbar */
  body {
    padding-bottom: 40px; /* Reduced padding */
  }
  
  /* Profile dropdown items */
  .profile-dropdown {
    background-color: white !important;
    padding: 4px 0 !important; /* Less padding */
    margin: 0 !important;
    border-radius: 4px !important;
    width: 230px !important; /* Narrower */
    max-width: 90vw !important;
    max-height: none !important;
    overflow: visible !important;
  }
  
  .profile-dropdown li {
    display: block !important;
    width: 100% !important;
    clear: both !important;
  }
  
  .profile-dropdown li a {
    display: block !important;
    padding: 5px 15px !important; /* Less padding */
    clear: both !important;
    font-weight: normal !important;
    line-height: 1.3 !important; /* Tighter line height */
    white-space: nowrap !important;
    color: #333 !important;
    text-decoration: none !important;
    font-size: 13px !important; /* Smaller font */
  }
  
  .profile-dropdown li a i {
    font-size: 14px !important; /* Smaller icons */
    width: 16px !important;
    margin-right: 5px !important;
  }
  
  .profile-dropdown li a:hover {
    background-color: #f5f5f5 !important;
    color: #262626 !important;
  }
  
  .profile-dropdown .divider {
    height: 1px !important;
    margin: 4px 0 !important; /* Less margin */
    overflow: hidden !important;
    background-color: #e5e5e5 !important;
  }
  
  /* Content box inside dropdown */
  .profile-dropdown .content-box {
    display: none !important;
  }
}

/* Tablet styles */
@media (min-width: 768px) and (max-width: 991px) {
   /* Reset search bar styling */
   .navbar-form.navbar-right {
    width: auto !important;
    margin-top: 8px !important;
    margin-bottom: 8px !important;
    padding: 0 15px !important;
  }
  
  /* Fix search form group */
  .navbar-form .form-group {
    margin-bottom: 0 !important;
    display: inline-block !important;
  }
  
  /* Reset search input styling */
  .navbar-form .input-text {
    width: auto !important;
  }
  
  /* Fix profile dropdown */
  .setting-dropdown-menu .profile-dropdown {
    width: auto !important;
    max-width: none !important;

  }
  
  /* Reset container styling */
  .navbar > .container {
    width: auto !important;
    padding: 0 15px !important;
  }
  
  /* Reset flex structure */
  #main-public-nav-collapse {
    display: block !important;
    flex-direction: initial !important;
  }
  
  /* Adjust spacing for menu items */
  .navbar-nav > li > a {
    padding: 15px 10px;
  }
  
  /* Fix profile dropdown positioning */
  .profile-dropdown {
    right: 0;
    left: auto;
  }
  
  /* Reduce size of logo slightly for tablet */
  #participate-logo {
    max-width: 200px;
  }
}