/* Base styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
  box-sizing: border-box;
}

/* Mobile-specific adjustments for all pages */
@media (max-width: 767px) {
  body {
    padding-top: 5rem; /* Add padding to accommodate centered logo and hamburger button */
  }
  
  .gradient-bg {
    padding-top: 1rem; /* Add additional padding to gradient backgrounds */
  }
}

html {
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

/* Header logo styles */
.header-logo {
  display: inline-flex;
  width: 1.125rem;
  height: 1.125rem;
  background-color: #363b45;
  margin: auto;
  -webkit-mask-image: url("../assets/icons/ability-ai.svg");
  mask-image: url("../assets/icons/ability-ai.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 50% 50%;
  mask-position: 50% 50%;
  -webkit-mask-size: 1.125rem;
  mask-size: 1.125rem;
}

.header-logo-link {
  position: relative;
  width: 1.875rem;
  height: 1.875rem;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  margin: auto;
  z-index: 10;
}

.header-logo-wrapper {
  width: 6.875rem;
  height: 3rem;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  margin: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

/* Mobile specific logo positioning */
@media (max-width: 767px) {
  .header-logo-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 1rem;
    z-index: 25;
    pointer-events: none; /* Allow clicks to pass through to elements below */
  }
  
  .header-logo-link {
    pointer-events: auto; /* Re-enable clicks on the logo itself */
  }
  
  /* Add extra top padding to the main content to prevent overlap with centered logo */
  .with-sidebar {
    padding-top: 3.5rem;
  }
}

.header-logo-wrapper:before, .header-logo-wrapper:after {
  content: "";
  position: relative;
  width: 100%;
  height: 100%;
  display: inline-flex;
}

.header-logo-wrapper:before {
  height: 0.1875rem;
  background: linear-gradient(90deg, rgba(255, 0, 0, 0) 0%, #FF0000 21.5%, #FFA1A1 50%, #FF0000 73.5%, rgba(255, 0, 0, 0) 100%);
  z-index: 2;
}

.header-logo-wrapper:after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(48.43% 48.43% at 50% 8.02%, rgba(255, 0, 0, 0.16) 0%, rgba(255, 0, 0, 0) 100%);
  z-index: 1;
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition-property: background-color, border-color, color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.btn-primary {
  background-color: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background-color: #2563eb;
}

.btn-secondary {
  background-color: white;
  color: #4b5563;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover {
  background-color: #f9fafb;
}

/* Form control styles */
.form-control {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  width: 100%;
  font-size: 0.875rem;
}

.form-control:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Layout utilities */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

/* Flexbox utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

/* Text utilities */
.text-center {
  text-align: center;
}

.font-bold {
  font-weight: 700;
}

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

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

/* Mobile-specific utilities */
@media (max-width: 767px) {
  .md\:block {
    display: none !important;
  }

  .hidden-mobile {
    display: none !important;
  }

  .mobile-only {
    display: block;
  }

  .mobile-flex {
    display: flex;
  }

  .mobile-p-4 {
    padding: 1rem;
  }

  .mobile-p-2 {
    padding: 0.5rem;
  }

  .mobile-gap-2 {
    gap: 0.5rem;
  }

  .mobile-w-full {
    width: 100%;
  }

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

  .mobile-text-center {
    text-align: center;
  }
  
  /* Fix for Add Product and Add Experiment buttons */
  .card .connect-btn {
    width: auto !important;
    min-width: 160px !important;
    max-width: 200px !important;
  }
  
  /* Fix button container alignment */
  .experiment-list-header,
  .product-list-header,
  .campaign-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

/* Desktop-specific utilities */
@media (min-width: 768px) {
  .mobile-only {
    display: none !important;
  }

  .hidden-desktop {
    display: none !important;
  }

  .desktop-block {
    display: block;
  }

  .desktop-flex {
    display: flex;
  }
}

/* Animation for login and register pages */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Button styling */
.connect-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background-color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.connect-btn:hover {
  background-color: #f9fafb;
  border-color: rgba(0, 0, 0, 0.15);
}

/* Meta (blue) button variant that overrides connect-btn defaults */
.btn-meta {
  background-color: #0866FF !important; /* Meta blue */
  border-color: transparent !important;
  color: #FFFFFF !important;
  border-radius: 8px !important; /* Ensure consistent rounding */
  box-shadow: none !important;
  outline: none !important;            /* remove outline artifacts */
  outline-offset: 0 !important;        /* remove negative offsets */
}

.btn-meta:hover {
  background-color: #2b7bff !important; /* lighter on hover */
  color: #FFFFFF !important;
  border-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  outline-offset: 0 !important;
}

/* Ensure buttons don't expand too much on any screen size */
.add-experiment-btn,
.add-product-btn,
.connect-btn {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Image selection active state */
.selectable-image-container.active {
  border-color: #363B45 !important;
  background-color: #363B45 !important;
  box-shadow: 0 0 0 2px #363B45;
}

.selectable-image-container.active img {
  opacity: 0.8;
}

.selectable-image-container.active::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 2rem;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

/* Info tooltip styles */
.info-tooltip:hover .tooltip-content {
  opacity: 1;
  visibility: visible;
}
