/* Import Montserrat font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

:root {
  /* Brand Color Palette - Based on #00ccff (300) and #003245 (900) */
  --brand-25: #f0fdff;
  --brand-50: #e6fcff;
  --brand-100: #ccf7ff;
  --brand-200: #99efff;
  --brand-300: #00ccff;
  --brand-400: #00b8e6;
  --brand-500: #00a3cc;
  --brand-600: #008fb3;
  --brand-700: #007a99;
  --brand-800: #005678;
  --brand-900: #003245;
  --brand-950: #00242f;

  /* Gray Color Palette */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --gray-950: #020617;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html, body {
  height: 100%;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--gray-50) !important;
  display: flex;
  flex-direction: column;
  color: var(--gray-600) !important;
  margin-bottom: 60px;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--brand-500);
}

html {
  position: relative;
  min-height: 100%;
}

/* Custom buttons matching EQApp style */
.btn {
  border-radius: 50px;
  box-shadow: none;
  text-transform: none;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: auto;
  padding: 8px 24px;
  transition: all 0.2s ease;
}

.btn-primary {
  color: #fff;
  background-color: var(--brand-500);
  border-color: var(--brand-500);
}

.btn-primary:hover {
  background-color: var(--brand-600);
  border-color: var(--brand-600);
  box-shadow: none;
}

.btn-secondary {
  color: var(--gray-600);
  background-color: var(--gray-100);
  border-color: var(--gray-200);
}

.btn-secondary:hover {
  background-color: var(--gray-200);
  border-color: var(--gray-300);
  box-shadow: none;
}

.btn-outline-primary {
  color: var(--brand-500);
  background-color: transparent;
  border-color: var(--brand-500);
}

.btn-outline-primary:hover {
  color: #fff;
  background-color: var(--brand-500);
  border-color: var(--brand-500);
  box-shadow: none;
}

/* Navigation bar styling */
.navbar {
  background-color: white !important;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0px 2px 8px rgba(0,0,0,0.08);
  min-height: 56px;
}

.navbar-brand {
  font-weight: 600;
  color: var(--brand-800) !important;
  font-size: 1.25rem;
}

.nav-link {
  font-weight: 500;
  color: var(--gray-600) !important;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin: 0 4px;
}

.nav-link:hover {
  color: var(--brand-600) !important;
  background-color: var(--brand-50);
}

/* User profile dropdown styling */
.profile-dropdown {
  position: relative !important;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--gray-600);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
}

.profile-button:hover {
  background-color: var(--brand-50);
  color: var(--brand-600);
}

.profile-button:focus {
  outline: none;
  background-color: var(--brand-50);
  color: var(--brand-600);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--brand-500);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  overflow: hidden;
  border: 2px solid var(--brand-200);
  transition: all 0.2s ease;
}

.user-avatar:hover {
  border-color: var(--brand-400);
}

.profile-dropdown .profile-dropdown-menu {
  position: absolute !important;
  top: calc(100% + 4px) !important;
  right: 0 !important;
  left: auto !important;
  background: white !important;
  border: 1px solid var(--gray-200) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
  min-width: 220px !important;
  z-index: 99999 !important;
  padding: 8px 0 !important;
  display: none;
  margin: 0 !important;
}

.profile-dropdown .profile-dropdown-menu.show {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

/* Remove the always visible debug rule - dropdown should be hidden by default */

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  color: var(--gray-600);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.profile-dropdown-item:hover {
  background-color: var(--brand-50);
  color: var(--brand-600);
  text-decoration: none;
}

.profile-dropdown-item svg {
  width: 18px;
  height: 18px;
  color: var(--gray-500);
}

.profile-dropdown-item:hover svg {
  color: var(--brand-500);
}

/* Specific styling for logout button */
.profile-dropdown-item[onclick*="logout"] {
  border-top: 1px solid var(--gray-200);
  margin-top: 4px;
}

.profile-dropdown-item[onclick*="logout"]:hover {
  background-color: #fef2f2;
  color: #dc2626;
}

.profile-dropdown-item[onclick*="logout"]:hover svg {
  color: #dc2626;
}

/* Ensure dropdown is above other elements */
.navbar .dropdown {
  position: static;
}

.navbar .dropdown-menu {
  position: absolute;
}

/* Proper dropdown show/hide functionality */
.profile-dropdown-menu.show {
  display: block !important;
  background: #f0f9ff !important; /* Temporary debug background */
  border: 2px solid #0066cc !important; /* Temporary debug border */
}

.user-info {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin: 0;
}

.user-email {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin: 2px 0 0 0;
}

/* Main content area - takes up available space */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Footer styling */
.footer {
  background-color: white;
  border-top: 1px solid var(--gray-200);
  color: var(--gray-500);
  margin-top: auto;
  padding: 1rem 0;

.footer a {
  color: var(--brand-500);
  text-decoration: none;
}

.footer a:hover {
  color: var(--brand-600);
  text-decoration: underline;
}

/* Container and layout adjustments */
.container {
  max-width: 1200px;
}

/* Form controls */
.form-control:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 0.2rem rgba(0, 163, 204, 0.25);
}

/* Links */
a {
  color: var(--brand-500);
  text-decoration: none;
}

a:hover {
  color: var(--brand-600);
  text-decoration: underline;
}

/* Mobile responsive styles */
@media (max-width: 575.98px) {
  /* Mobile navbar adjustments */
  .navbar .container {
    padding-left: 8px;
    padding-right: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  /* Logo positioning - left side */
  .navbar-brand {
    margin: 0;
    order: 1;
  }
  
  /* Mobile profile button positioning - right side */
  .profile-button.d-sm-none {
    order: 3;
    margin-left: auto;
  }
  
  /* Hide navbar toggler completely */
  .navbar-toggler {
    display: none !important;
  }
  
  /* Mobile dropdown menu positioning - align to right */
  .profile-dropdown-menu.d-sm-none {
    position: fixed !important;
    /* top and right will be set dynamically by JavaScript */
    left: auto !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: calc(100vw - 16px) !important;
    z-index: 99999 !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2) !important;
    background: white !important;
    border: 1px solid var(--gray-200) !important;
    padding: 8px 0 !important;
  }
  
  /* Ensure mobile dropdown shows properly */
  .profile-dropdown-menu.d-sm-none.show {
    display: block !important;
  }
  
  /* Mobile login button styling */
  .btn.d-sm-none.ms-auto {
    order: 3;
    margin-left: auto;
    white-space: nowrap;
  }
  
  /* Responsive dropdown width for very small screens */
  @media (max-width: 320px) {
    .profile-dropdown-menu.d-sm-none {
      width: calc(100vw - 16px) !important;
      /* Position will be set dynamically, but ensure it doesn't go off-screen */
      max-width: calc(100vw - 16px) !important;
    }
    
    /* Adjust login button text on very small screens */
    .btn.d-sm-none.ms-auto {
      padding: 6px 12px !important;
      font-size: 0.8rem !important;
    }
  }
}

@media (max-width: 767.98px) {
  /* Tablet and mobile adjustments */
  .navbar-nav {
    flex-direction: row !important;
    align-items: center;
  }
  
  .profile-dropdown {
    position: relative;
  }
  
  /* Adjust dropdown for tablets */
  .profile-dropdown .profile-dropdown-menu {
    right: 0 !important;
    left: auto !important;
    min-width: 280px !important;
  }
}