/* Custom Color Overrides for Corelogic (Design System) */

:root {
  /* Design System Colors */
  --default-font: "Open Sans", system-ui, -apple-system, sans-serif;
  --heading-font: "Poppins", sans-serif;
  --nav-font: "Poppins", sans-serif;

  /* Corelogic Color Palette */
  --background-color: #F8FAFC;
  --default-color: #334155;
  --heading-color: #0F172A;
  --accent-color: #0369A1;
  --surface-color: #ffffff;
  --contrast-color: #ffffff;

  /* Nav Colors */
  --nav-color: #0F172A;
  --nav-hover-color: #0369A1;

  /* CoreBot Chatbot Dimensions */
  --corebot-width-desktop: 420px;
  --corebot-height-desktop: 720px;
  --corebot-width-tablet: 400px;
  --corebot-height-tablet: 650px;
  --corebot-height-mobile: 600px;
  --corebot-height-small: 550px;
  --corebot-border-radius: 20px;
  --corebot-border-radius-small: 16px;

  /* CoreBot Avatar Dimensions */
  --corebot-avatar-size: 70px;
  --corebot-avatar-img-size: 65px;
  --corebot-avatar-size-mobile: 60px;
  --corebot-avatar-img-size-mobile: 55px;
}

.dark-background {
  --background-color: #0F172A;
  --default-color: #ffffff;
  --heading-color: #ffffff;
  --surface-color: #1e293b;
}

body {
  font-family: var(--default-font);
  padding-top: 140px; /* Account for fixed header height */
}

/* Adjust for mobile */
@media (max-width: 768px) {
  body {
    padding-top: 120px;
  }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
}

.sitename {
  font-family: var(--heading-font);
  font-weight: 600;
}

.btn-primary, .primary-cta {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  transition: all 0.3s ease;
}

.btn-primary:hover, .primary-cta:hover {
  background-color: #0284c7;
  border-color: #0284c7;
  transform: translateY(-2px);
  cursor: pointer;
}

/* Trust & Authority Badge Styling */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(3, 105, 161, 0.1);
  border-radius: 8px;
  color: var(--accent-color);
  font-weight: 500;
  font-size: 14px;
}

.trust-badge i {
  font-size: 18px;
}

/* Custom Hover States - Smooth Transitions */
.service-item, .product-card, .value-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.service-item:hover, .product-card:hover, .value-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(3, 105, 161, 0.15);
}

/* Accessibility - Focus States */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Badge Pulse Animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.trust-badge:hover {
  animation: pulse 2s ease-in-out infinite;
}

/* CoreBot Avatar Button */
#corebot-avatar {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: var(--corebot-avatar-size);
  height: var(--corebot-avatar-size);
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  box-shadow: 0 8px 20px rgba(3,105,161,0.25);
  transition: 0.3s;
}

#corebot-avatar:hover {
  transform: scale(1.1);
}

#corebot-avatar img {
  width: var(--corebot-avatar-img-size);
  height: var(--corebot-avatar-img-size);
  border-radius: 50%; /* makes image circular*/
  transition: 0.3s ease;
}

/* Overlay (dark background) */
#corebot-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s ease;
  z-index: 999;
}

/* Chatbot Frame - Responsive Design */
#corebot-frame {
  position: fixed;
  bottom: 100px;
  right: 20px;
  /* Desktop: Original dimensions (420x720) */
  width: var(--corebot-width-desktop);
  height: var(--corebot-height-desktop);
  border: none;
  border-radius: var(--corebot-border-radius);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: 0.3s ease;
  z-index: 1000;
  background: transparent;
  box-shadow: 0 10px 40px rgba(3, 105, 161, 0.2);
}

/* Tablet & Landscape Mobile (≤992px) */
@media (max-width: 992px) {
  #corebot-frame {
    width: var(--corebot-width-tablet);
    height: var(--corebot-height-tablet);
    bottom: 90px;
  }
}

/* Tablet Portrait & Large Mobile (≤768px) */
@media (max-width: 768px) {
  #corebot-frame {
    width: calc(100% - 40px);
    max-width: var(--corebot-width-tablet);
    height: var(--corebot-height-mobile);
    right: 20px;
    left: 20px;
    margin: 0 auto;
  }
}

/* Small Mobile Devices - Standard Android phones (≤480px) */
@media (max-width: 480px) {
  #corebot-frame {
    width: calc(100% - 20px);
    height: calc(100vh - 180px);
    max-height: var(--corebot-height-mobile);
    bottom: 85px;
    right: 10px;
    left: 10px;
  }

  #corebot-avatar {
    width: var(--corebot-avatar-size-mobile);
    height: var(--corebot-avatar-size-mobile);
    bottom: 15px;
    right: 15px;
  }

  #corebot-avatar img {
    width: var(--corebot-avatar-img-size-mobile);
    height: var(--corebot-avatar-img-size-mobile);
  }
}

/* Very Small Devices - Compact Android phones (≤360px) */
@media (max-width: 360px) {
  #corebot-frame {
    width: calc(100% - 16px);
    height: calc(100vh - 160px);
    max-height: var(--corebot-height-small);
    bottom: 80px;
    right: 8px;
    left: 8px;
    border-radius: var(--corebot-border-radius-small);
  }
}

/* ACTIVE STATE */
#corebot-frame.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#corebot-overlay.active {
  opacity: 1;
  visibility: visible;
}
