/* Curatora.ai - Essential Custom Styles */
/* This file contains only complex component styles that cannot be easily replaced with Tailwind utilities */
/* Common styles (variables, buttons, forms) are in common-styles.css */

/* Brand Gradient Class - for user and public pages */
.brand-gradient {
  position: relative;
  background:
    radial-gradient(100% 100% at var(--x1) var(--y1), var(--secondary) 0%, transparent),
    radial-gradient(100% 100% at var(--x2) var(--y2), var(--accent) 0%, transparent),
    var(--primary);
  animation: gradient-blob 15s ease-in-out infinite;
}

/* Typography colors are defined in common-styles.css */

/* Text inside gradient background elements (not body) should be white */
.brand-gradient:not(body) p,
.brand-gradient:not(body) h1,
.brand-gradient:not(body) h2,
.brand-gradient:not(body) h3,
.brand-gradient:not(body) h4,
.brand-gradient:not(body) h5,
.brand-gradient:not(body) h6,
.brand-gradient:not(body) li,
.brand-gradient:not(body) td,
.brand-gradient:not(body) th,
.brand-gradient:not(body) div,
.brand-gradient:not(body) button {
  color: white;
}

/* Light overlay for body background only on public pages */
body.brand-gradient:not(.user-page)::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
  z-index: 0;
}

/* Ensure content appears above overlay */
body.brand-gradient > nav {
  z-index: 50;
}

body.brand-gradient:not(.user-page) > nav {
  background-color: rgba(255, 255, 255, 0.9);
}

body.brand-gradient:not(.user-page) > footer {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 10;
}

body.brand-gradient > main,
body.brand-gradient > section,
body.brand-gradient > header {
  position: relative;
  z-index: 1;
}

/* Admin Gradient Class - for admin pages */
.admin-gradient {
  background:
    radial-gradient(100% 100% at var(--x1) var(--y1), var(--light) 0%, transparent),
    radial-gradient(100% 100% at var(--x2) var(--y2), var(--danger) 0%, transparent),
    var(--warning);
  animation: gradient-blob 15s ease-in-out infinite;
}

/* Button styles are defined in common-styles.css */

/* Admin button modifier - only changes background colors */
/* Using higher specificity with btn-curatora.btn-admin */
.btn-curatora.btn-admin {
  background:
    radial-gradient(100% 100% at var(--x1) var(--y1), var(--light) 0%, transparent),
    radial-gradient(100% 100% at var(--x2) var(--y2), var(--danger) 0%, transparent),
    var(--warning);
}

.btn-curatora.btn-admin:hover {
  animation: gradient-blob 15s ease-in-out infinite;
  box-shadow: none;
}

/* Google Consent Mode v2 Styles - Complex component that needs custom CSS */
.consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

.consent-banner.show {
  transform: translateY(0);
}

.consent-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.consent-banner-header {
  margin-bottom: 1.5rem;
}

.consent-banner-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.consent-banner-header p {
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.5;
}

.consent-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.consent-option {
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #f9fafb;
}

.consent-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 0.75rem;
}

.consent-toggle input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 48px;
  height: 28px;
  background: #d1d5db;
  border-radius: 14px;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.consent-toggle input[type="checkbox"]:checked + .toggle-slider {
  background: var(--primary);
}

.consent-toggle input[type="checkbox"]:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.consent-label strong {
  display: block;
  font-weight: 600;
  color: #1f2937;
  font-size: 0.875rem;
}

.consent-label small {
  display: block;
  color: #6b7280;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.consent-banner-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.consent-banner-actions button {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-accept-selected {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-accept-selected:hover {
  background: var(--primary);
  color: white;
}

.btn-reject-all {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-reject-all:hover {
  background: var(--danger);
  color: white;
}

.consent-banner-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.75rem;
}

.consent-banner-footer a,
.text-link {
  color: var(--primary);
  text-decoration: none;
}

.consent-banner-footer a:hover,
.text-link:hover {
  text-decoration: underline;
}

.text-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
}

/* Main Content Area */
.main-content {
  padding: 1.5rem;
  height: calc(100vh - var(--navbar-height));
  margin-top: var(--navbar-height);
  background: transparent;
  overflow-y: auto;
}

/* Dashboard Cards */
.dashboard-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  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 #e5e7eb;
}

.dashboard-card h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.dashboard-card .metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.dashboard-card .metric-label {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Button styles removed - using btn, btn-curatora, btn-primary, btn-secondary, btn-accent, btn-warning, btn-danger, btn-success from input.css */

/* Admin Toggle Switch - Complex component */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: 0.3s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Default: Public and User pages use secondary color when active */
.toggle-switch input:checked + .slider {
  background-color: var(--secondary);
}

/* Admin pages use warning color when active */
.admin-gradient .toggle-switch input:checked + .slider {
  background-color: var(--warning);
}

.toggle-switch input:checked + .slider:before {
  transform: translateX(20px);
}

.toggle-switch input:focus + .slider {
  box-shadow: 0 0 0 3px rgba(14, 118, 168, 0.1);
}

/* User Dropdown Menu - Complex positioning */
.user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.user-avatar:hover {
  background-color: #0a5d7a;
}

.user-dropdown-header {
  padding: 1rem;
  border-bottom: 1px solid #f3f4f6;
  background-color: #f9fafb;
}

.user-dropdown-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.user-dropdown-email {
  font-size: 0.75rem;
  color: #6b7280;
}

.user-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #374151;
  text-align: left;
  background: none;
  border: none;
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.user-dropdown-item.user-dropdown-item-admin {
  text-transform: uppercase;
  color: var(--warning);
  font-weight: 900;	
}

.user-dropdown-item:hover {
  background-color: #f9fafb;
}

.user-dropdown-item.logout {
  color: #dc2626;
  border-top: 1px solid #f3f4f6;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
}

.user-dropdown-item.logout:hover {
  background-color: #fef2f2;
}

.user-dropdown.hidden {
  display: none;
}

/* Navbar - Complex fixed positioning */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  height: var(--navbar-height);
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-logo {
  height: 2.5rem;
  width: auto;
}

.navbar-admin-badge {
  font-size: 0.875rem;
  font-weight: 600;
  color: #dc2626;
  background-color: #fef2f2;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

.navbar-nav {
  display: flex;
  gap: 2rem;
  color: #374151;
  font-weight: 500;
}

.navbar-nav-item {
  color: #374151;
  font-weight: 500;
  transition: color 0.15s ease;
  text-decoration: none;
}

.navbar-nav-item:hover {
  color: var(--primary);
}

.navbar-nav-item.active {
  color: var(--primary);
  font-weight: 600;
}

.navbar-user-section {
  position: relative;
}

/* Responsive Design */
@media (max-width: 768px) {
  .consent-banner-content {
    padding: 1rem;
  }
  
  .consent-options {
    grid-template-columns: 1fr;
  }
  
  .consent-banner-actions {
    flex-direction: column;
  }
  
  .consent-banner-actions button {
    width: 100%;
  }
  
  .consent-banner-footer {
    text-align: center;
  }
  
  .navbar {
    padding: 0.75rem 1rem;
  }
  
  .navbar-nav {
    gap: 1rem;
  }
}

/* Modal Styles - Consistent centering across all pages */
.modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999 !important;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Lighter backdrop for user pages */
body.user-page .modal-backdrop {
  background-color: rgba(0, 0, 0, 0.3);
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-container {
  position: relative;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 100% !important;
  padding: 1rem;
  margin: 0 !important;
  flex-shrink: 0;
}

.modal {
  background: white;
  border-radius: 0.75rem; /* rounded-xl */
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); /* shadow-xl */
  position: relative;
  width: 100%;
  margin: auto !important;
  padding: 30px;
  flex-shrink: 0;
  align-self: center;
  /* max-width is controlled by popup-s, popup-m, popup-l classes */
}

.modal-s {
  max-width: 28rem;
}

.modal-l {
  max-width: 56rem;
}

/* Popup Size Classes */
.popup-s {
  max-width: 24rem; /* max-w-sm - for small popups (messages/confirmations) */
}

.popup-m {
  max-width: 28rem; /* max-w-md - for medium popups (creating entities with few fields) */
}

.popup-l {
  max-width: 42rem; /* max-w-2xl - for large popups (long content/entities) */
}

.popup-xl {
  max-width: 1024px; /* Extra large popups (for content with images side by side) */
}

/* Sticky Table Headers */
/* The table container needs to allow sticky positioning within the scrolling content-area */
#content-area .table-container {
  position: relative;
}

#content-area .table-container table {
  position: relative;
  border-collapse: separate;
  border-spacing: 0;
}

#content-area .table-container table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

#content-area .table-container table thead th {
  background-color: #f9fafb !important; /* bg-gray-50 - ensure solid background */
  position: sticky;
  top: 0;
  z-index: 11;
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05); /* subtle shadow for separation */
}

/* Ensure thead row stays on top when scrolling */
#content-area .table-container table thead tr {
  background-color: #f9fafb; /* bg-gray-50 */
  position: sticky;
  top: 0;
  z-index: 10;
}