/* Mobile Header - Clean minimal design for mobile devices
   Only visible on screens < 768px
*/

/* Hide mobile header and warning banner on desktop by default */
.mobile-header,
.mobile-warning-banner {
  display: none !important;
}

/* Show mobile header only on mobile devices */
@media (max-width: 767px) {
  
  /* Hide desktop header on mobile */
  .headerbar {
    display: none !important;
  }

  /* Hide sidebar on mobile */
  .sidebar {
    display: none !important;
  }

  /* Show mobile header */
  .mobile-header,
  .mobile-warning-banner {
    display: block !important;
  }

  .mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }

  /* Container */
  .mobile-header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    max-width: 100%;
  }

  /* Left Side: Title + Badge */
  .mobile-header__left {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-header__title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.5px;
  }

  .mobile-header__badge-dot {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
  }

  /* Right Side: User or Login */
  .mobile-header__right {
    display: flex;
    align-items: center;
  }

  /* Login Button (for non-authenticated users) */
  .mobile-header__login-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #7AAACE;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease;
  }

  .mobile-header__login-btn:hover {
    background: #7AAACE;
  }

  .mobile-header button {
    background: #7AAACE;
    color: #fff;
    border-color: #7AAACE;
  }

  .mobile-header button:hover {
    background: #7AAACE;
    color: #fff;
    border-color: #7AAACE;
  }

  /* User Menu */
  .mobile-header__user-menu {
    position: relative;
  }

  .mobile-header__user-menu > summary {
    list-style: none;
    cursor: pointer;
  }

  .mobile-header__user-menu > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-header__user-toggle {
    display: flex;
    align-items: center;
    padding: 0;
    background: none;
    border: none;
  }

  /* Avatar */
  .mobile-header__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #f0f0f0;
    object-fit: cover;
    background: #e5e7eb;
    cursor: pointer;
  }

  /* Dropdown Menu */
  .mobile-header__dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 280px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0;
    overflow: hidden;
    z-index: 10000;
  }

  /* Dropdown Header with User Info */
  .mobile-header__dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
  }

  .mobile-header__dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .mobile-header__dropdown-info {
    flex: 1;
    min-width: 0;
  }

  .mobile-header__dropdown-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-header__dropdown-email {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Dropdown Items */
  .mobile-header__dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: #374151;
    font-size: 15px;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
    position: relative;
  }

  .mobile-header__dropdown-item:hover {
    background: #f9fafb;
  }

  .mobile-header__item-icon {
    width: 20px;
    height: 20px;
    color: #6b7280;
    flex-shrink: 0;
  }

  .mobile-header__item-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 0 6px;
  }

  .mobile-header__dropdown-item--danger {
    color: #ef4444;
  }

  .mobile-header__dropdown-item--danger:hover {
    background: #fef2f2;
  }

  .mobile-header__dropdown-item--danger .mobile-header__item-icon {
    color: #ef4444;
  }

  .mobile-header__divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
  }

  /* Adjust layout padding for fixed mobile header */
  .layout {
    padding-top: 65px !important;
  }

  /* Make main content full width on mobile */
  .layout {
    grid-template-columns: 1fr !important;
  }

  /* Hide rightbar on mobile */
  .rightbar {
    display: none !important;
  }

  /* Temporary Mobile Warning Banner */
  .mobile-warning-banner {
    position: fixed;
    top: 65px; /* Below mobile header */
    left: 0;
    right: 0;
    z-index: 9998;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 2px solid #f59e0b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
  }

  @keyframes slideDown {
    from {
      transform: translateY(-100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .mobile-warning-banner__content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    max-width: 100%;
  }

  .mobile-warning-banner__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: #d97706;
  }

  .mobile-warning-banner__text {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #92400e;
  }

  .mobile-warning-banner__text strong {
    font-weight: 700;
    color: #78350f;
  }

  /* Adjust layout padding to account for warning banner */
  body {
    padding-top: 130px !important; /* 65px header + 65px banner */
  }

}
