/* Ellipse Color Scheme - Updated to match new design */
:root {
  --ellipse-primary: #2B4C8C;  /* Updated to match the blue in screenshot */
  --ellipse-secondary: #6B7FDB;  /* Purple-blue for buttons */
  --ellipse-tertiary: #E8EBFF;  /* Light purple-blue background */
  --ellipse-gray: #6B7280;
  --ellipse-light-gray: #F3F4F6;
  --ellipse-border: #E5E7EB;
  --ellipse-text-dark: #1F2937;
  --ellipse-text-muted: #6B7280;
  --ellipse-bg-light: #F9FAFB;
  --ellipse-success: #10B981;
  --ellipse-danger: #EF4444;
}

/* Base Styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--ellipse-text-dark);
  background-color: var(--ellipse-bg-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  background-color: var(--ellipse-bg-light);
}

/* Logo */
.logo {
  max-height: 40px;
  width: auto;
}

/* Fixed width elements to prevent jumping on resize */
.fixed-width-brand {
  min-width: 180px;
  display: flex;
  align-items: center;
}

.fixed-width-nav {
  min-width: 250px;
}

/* Header Wrapper */
.header {
  background-color: transparent;
  position: relative;
  z-index: 1000;
}

/* Navbar */
.navbar {
  padding: 1rem 1.5rem;
  overflow: visible;
  min-height: 72px;
  background-color: white !important;
  position: relative;
  z-index: 1000;
}

.navbar-light .navbar-nav .nav-link {
  color: var(--ellipse-text-dark);
  font-weight: 500;
  font-size: 0.875rem;
}

.navbar-light .navbar-nav .nav-link:hover {
  color: var(--ellipse-secondary);
}

/* User Profile Dropdown */
.user-profile-dropdown {
  position: relative;
  z-index: 1100;
}

.user-profile-dropdown .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.user-profile-dropdown .dropdown-toggle:hover,
.user-profile-dropdown .dropdown-toggle:focus,
.user-profile-dropdown .dropdown-toggle:active,
.user-profile-dropdown .dropdown-toggle.show {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.user-profile-dropdown .dropdown-toggle::after {
  display: none;
}

/* Fix navbar dropdown menu z-index */
.navbar .dropdown-menu {
  z-index: 1100 !important;
  position: absolute !important;
}

.user-profile-icon {
  width: 32px;
  height: 32px;
  background-color: var(--ellipse-secondary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  overflow: hidden;
}

.user-profile-icon i {
  font-size: 2rem;
  line-height: 1;
  margin-top: -0.15rem;
}

.user-name {
  font-weight: 500;
  color: var(--ellipse-text-dark);
}

.dropdown-menu {
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--ellipse-border);
  padding: 0.5rem;
  margin-top: 0.5rem;
  z-index: 1050 !important;
}

/* Ensure dropdown toggles create stacking context */
.dropdown {
  position: relative;
}

.dropdown-item {
  padding: 0.5rem 1rem;
  color: var(--ellipse-text-dark);
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.dropdown-item:hover, .dropdown-item:focus {
  background-color: var(--ellipse-light-gray);
  color: var(--ellipse-primary);
}

/* Login/Register Buttons */
.login-btn, .register-btn {
  border-radius: 1.5rem;
  padding: 0.625rem 2rem;
  transition: all 0.2s ease;
  min-width: 120px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-block;
}

.login-btn {
  background-color: #032975;
  border-color: #032975;
  color: white !important;
}

.login-btn:hover {
  background-color: #021e4d;
  border-color: #021e4d;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(3, 41, 117, 0.2);
}

.register-btn {
  color: #032975;
  border: 2px solid #032975;
  background-color: white;
}

.register-btn:hover {
  background-color: #032975;
  border-color: #032975;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(3, 41, 117, 0.2);
}

/* Bootstrap Components Override */

/* Buttons */
.btn {
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--ellipse-secondary);
  border-color: var(--ellipse-secondary);
  color: white;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background-color: #5A6BC5 !important;
  border-color: #5A6BC5 !important;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--ellipse-light-gray);
  border-color: var(--ellipse-border);
  color: var(--ellipse-text-dark);
}

.btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active {
  background-color: var(--ellipse-border) !important;
  border-color: var(--ellipse-border) !important;
  color: #1F2937 !important;
}

/* Specific rule for modal buttons to ensure text stays dark */
.modal-footer .btn-secondary:hover,
.modal-footer .btn-secondary:focus,
.modal-footer .btn-secondary:active,
.modal .btn-secondary:hover,
.modal .btn-secondary:focus,
.modal .btn-secondary:active,
button.btn-secondary:hover,
button.btn-secondary:focus,
button.btn-secondary:active {
  color: #1F2937 !important;
}

.btn-outline-primary {
  color: var(--ellipse-secondary);
  border-color: var(--ellipse-secondary);
}

.btn-outline-primary:hover {
  background-color: var(--ellipse-secondary);
  border-color: var(--ellipse-secondary);
  color: white;
}

.btn-outline-secondary {
  color: var(--ellipse-text-dark);
  border-color: var(--ellipse-border);
  background-color: white;
}

.btn-outline-secondary:hover {
  background-color: var(--ellipse-light-gray);
  border-color: var(--ellipse-border);
  color: var(--ellipse-text-dark);
}

.btn-outline-info {
  color: var(--ellipse-secondary);
  border-color: var(--ellipse-border);
  background-color: white;
}

.btn-outline-info:hover {
  background-color: var(--ellipse-tertiary);
  border-color: var(--ellipse-secondary);
  color: var(--ellipse-secondary);
}

/* Cards */
.card {
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid var(--ellipse-border);
  background-color: white;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}

/* Ensure cards don't overlap dropdowns */
.card-body {
  position: relative;
  z-index: 1;
}

.card-header {
  background-color: white;
  border-bottom: 1px solid var(--ellipse-border);
  font-weight: 600;
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  color: var(--ellipse-text-dark);
}

.card-body {
  padding: 1.5rem;
}

/* Bootstrap dropdown z-index fix */
.dropdown-menu.show {
  z-index: 1050 !important;
}

/* Ensure table dropdowns work properly */
.table-responsive .dropdown-menu {
  position: fixed !important;
  z-index: 1050 !important;
}

/* Modal fixes - ensure modals work with our stacking contexts */
/* Modal backdrop must be fixed to viewport */
.modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 1040 !important;
}

/* Modal must also be fixed to viewport */
.modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 1050 !important;
}

/* Push modal down from header */
.modal-dialog {
  margin-top: 100px !important;
}

/* Remove z-index from main-content when modal is open to prevent stacking context issues */
body.modal-open .main-content {
  z-index: auto !important;
}

/* Ensure body modal-open class doesn't interfere */
body.modal-open {
  overflow: hidden;
}

body.modal-open .modal {
  overflow-x: hidden;
  overflow-y: auto;
}

.card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Property Specific Styles */
.property-heading {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ellipse-text-dark);
}

/* Nav Tabs */
.nav-tabs {
  border-bottom: 1px solid var(--ellipse-border);
}

.nav-tabs .nav-link {
  color: var(--ellipse-text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  background-color: transparent;
  margin-bottom: -1px;
}

.nav-tabs .nav-link.active {
  color: var(--ellipse-secondary);
  border-bottom-color: var(--ellipse-secondary);
  background-color: transparent;
}

.nav-tabs .nav-link:hover:not(.active) {
  color: var(--ellipse-text-dark);
  border-bottom-color: var(--ellipse-border);
}

.nav-tabs .nav-link i {
  margin-right: 0.5rem;
  font-size: 1rem;
}

/* Field Cards */
.field-card {
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  background-color: white;
  border: 1px solid var(--ellipse-border) !important;
}

.field-card:hover {
  background-color: var(--ellipse-light-gray);
  border-color: var(--ellipse-secondary) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.field-value {
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--ellipse-text-muted);
  font-size: 0.875rem;
}

/* Progress Bar */
.progress {
  height: 6px;
  background-color: var(--ellipse-border);
  border-radius: 3px;
}

.progress-bar {
  background-color: var(--ellipse-secondary);
  border-radius: 3px;
}

/* Circular Progress Indicator */
.circular-progress {
  position: relative;
  width: 90px;
  height: 90px;
}

.circular-progress svg {
  transform: rotate(-90deg);
}

.circular-progress-bg {
  fill: none;
  stroke: var(--ellipse-border);
  stroke-width: 5;
}

.circular-progress-fill {
  fill: none;
  stroke: var(--ellipse-secondary);
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

.circular-progress-fill.complete {
  stroke: var(--ellipse-success);
}

.circular-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ellipse-secondary);
  transition: color 0.3s ease;
}

.circular-progress-text.complete {
  color: var(--ellipse-success);
}

/* Extraction Section */
.extraction-card {
  background-color: var(--ellipse-secondary);
  color: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.extraction-card h6 {
  color: white;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.extraction-card .btn {
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
}

.extraction-card .btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: white;
}

/* OR Divider */
.or-divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.or-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--ellipse-border);
}

.or-divider span {
  background-color: var(--ellipse-bg-light);
  padding: 0 1rem;
  position: relative;
  color: var(--ellipse-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Forms */
.form-control, .form-select {
  border: 1px solid var(--ellipse-border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  color: var(--ellipse-text-dark);
}

.form-control:focus, .form-select:focus {
  border-color: var(--ellipse-secondary);
  box-shadow: 0 0 0 3px rgba(107, 127, 219, 0.1);
}

.form-label {
  font-weight: 500;
  color: var(--ellipse-text-dark);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

/* Badges */
.badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

.badge-primary, .bg-primary {
  background-color: var(--ellipse-secondary) !important;
}

.badge-secondary, .bg-secondary {
  background-color: var(--ellipse-tertiary) !important;
  color: var(--ellipse-secondary) !important;
}

.badge-success, .bg-success {
  background-color: var(--ellipse-success) !important;
}

.badge-danger, .bg-danger {
  background-color: var(--ellipse-danger) !important;
}

/* Alerts */
.alert {
  border-radius: 0.5rem;
  font-size: 0.875rem;
  padding: 1rem;
}

.alert-info {
  background-color: var(--ellipse-tertiary);
  border: 1px solid rgba(107, 127, 219, 0.2);
  color: var(--ellipse-secondary);
}

.alert-warning {
  background-color: #FEF3C7;
  border: 1px solid #FBBF24;
  color: #92400E;
}

.alert-success {
  background-color: #D1FAE5;
  border: 1px solid #34D399;
  color: #065F46;
}

.alert-danger {
  background-color: #FEE2E2;
  border: 1px solid #F87171;
  color: #991B1B;
}

/* Tables */
.table {
  border-radius: 0.5rem;
  overflow: hidden;
  font-size: 0.875rem;
}

.table thead th {
  background-color: var(--ellipse-light-gray);
  color: var(--ellipse-text-dark);
  font-weight: 600;
  border-bottom: 1px solid var(--ellipse-border);
  padding: 0.75rem 1rem;
}

.table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--ellipse-border);
}

.table-hover tbody tr:hover {
  background-color: var(--ellipse-light-gray);
}

/* Confirmation Section */
.border-warning {
  border-color: #FBBF24 !important;
  border-width: 2px !important;
}

.bg-warning.bg-opacity-10 {
  background-color: rgba(251, 191, 36, 0.1) !important;
}

/* Footer */
.footer {
  background-color: white !important;
  border-top: 1px solid var(--ellipse-border);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
}

.footer-links li a {
  text-decoration: none;
  color: var(--ellipse-text-muted);
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-links li a:hover {
  color: var(--ellipse-secondary) !important;
}

/* Floating Meeting Request Button */
.meeting-request-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1050;
}

.meeting-request-fab .btn {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.2s ease;
  background-color: var(--ellipse-primary);
  border-color: var(--ellipse-primary);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.meeting-request-fab .btn:hover {
  background-color: var(--ellipse-secondary);
  border-color: var(--ellipse-secondary);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Utility Classes */
.cursor-pointer {
  cursor: pointer;
}

.text-muted {
  color: var(--ellipse-text-muted) !important;
}

.text-sm {
  font-size: 0.875rem;
}

.font-medium {
  font-weight: 500;
}

/* Breadcrumb */
.breadcrumb {
  background-color: transparent;
  padding: 0;
  margin-bottom: 0;
}

.breadcrumb-item {
  font-size: 0.875rem;
}

.breadcrumb-item a {
  color: var(--ellipse-text-muted);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  color: var(--ellipse-secondary);
}

.breadcrumb-item.active {
  color: var(--ellipse-text-dark);
}

/* Modal Adjustments */
.modal-content {
  border-radius: 0.75rem;
  border: 1px solid var(--ellipse-border);
}

.modal-header {
  border-bottom: 1px solid var(--ellipse-border);
  padding: 1.25rem 1.5rem;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ellipse-text-dark);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--ellipse-border);
  padding: 1rem 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .dropdown-menu {
    border: none;
    box-shadow: none;
    padding-left: 1rem;
  }
  
  .navbar-nav .dropdown-menu {
    position: static;
  }
  
  .login-btn, .register-btn {
    margin-top: 0.5rem;
    width: 100%;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    margin-top: 1rem;
  }
  
  .col-md-6.text-md-end {
    text-align: left !important;
    margin-top: 1rem;
  }
  
  .meeting-request-fab {
    bottom: 16px;
    right: 16px;
  }
  
  .meeting-request-fab .btn {
    width: 48px;
    height: 48px;
    font-size: 1.125rem;
  }

  .shadow-sm {
    border-color: #5A6BC5 !important;
  }
}