/* ========================================
   AI Chat Widget - Claim Project
   Compact Single-Window Layout
   ======================================== */

/* Hero with Background - Compact */
.hero-with-bg {
  position: relative;
  background-image: url('../images/sizifus.jpg');
  background-size: cover;
  background-position: center;
  min-height: auto;
  padding: 20px 0 30px;
}

.hero-with-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(25, 29, 146, 0.88) 0%,
    rgba(80, 97, 197, 0.75) 50%,
    rgba(200, 206, 213, 0.5) 100%
  );
  z-index: 1;
}

.hero-with-bg > * {
  position: relative;
  z-index: 2;
}

/* Hero Grid - Compact */
.grid_hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
}

.cell_left {
  padding-right: 10px;
}

.cell_left .heading {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.3;
  margin: 0;
  color: white;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.cell_left .bold-text {
  color: #c8ced5;
}

.sell_right {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Chat Widget Container - Compact */
.chat-widget {
  width: 100%;
  max-width: 360px;
  height: 340px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(80, 97, 197, 0.3);
  border-radius: 12px;
  box-shadow:
    0 8px 32px rgba(25, 29, 146, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chat-widget:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 40px rgba(25, 29, 146, 0.25),
    0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Chat Header - Compact */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--dark_blue) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.chat-avatar svg {
  width: 18px;
  height: 18px;
}

.chat-title {
  display: flex;
  flex-direction: column;
}

.chat-name {
  font-family: Roboto, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.chat-status {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.chat-header-actions {
  display: flex;
  gap: 6px;
}

.chat-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.chat-action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.chat-action-btn svg {
  width: 14px;
  height: 14px;
}

/* Chat Messages Area - Compact */
.chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fafafa;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--light-blue);
  border-radius: 2px;
}

/* Message Styles - Compact */
.chat-message {
  display: flex;
  gap: 8px;
  max-width: 90%;
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-message {
  align-self: flex-start;
}

.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-message .message-avatar {
  background: linear-gradient(135deg, var(--blue) 0%, var(--dark_blue) 100%);
  color: white;
}

.user-message .message-avatar {
  background: var(--light-blue);
  color: var(--dark_grey);
}

.message-avatar svg {
  width: 14px;
  height: 14px;
}

.message-content {
  padding: 8px 12px;
  border-radius: 12px;
  font-family: Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: var(--dark_grey);
}

.ai-message .message-content {
  background: white;
  border: 1px solid rgba(80, 97, 197, 0.15);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.user-message .message-content {
  background: linear-gradient(135deg, var(--blue) 0%, var(--dark_blue) 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-content p {
  margin: 0;
}

.message-content code {
  background: rgba(80, 97, 197, 0.1);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 12px;
}

.user-message .message-content code {
  background: rgba(255, 255, 255, 0.2);
}

/* Chat Input Container - Compact */
.chat-input-container {
  padding: 8px 10px 10px;
  background: white;
  border-top: 1px solid rgba(80, 97, 197, 0.1);
}

.chat-typing-indicator {
  display: flex;
  gap: 3px;
  padding: 6px 0;
  margin-bottom: 6px;
}

.chat-typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  animation: typing 1.4s infinite ease-in-out both;
}

.chat-typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.chat-typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #f5f5f5;
  border: 1px solid rgba(80, 97, 197, 0.2);
  border-radius: 10px;
  padding: 6px 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-wrapper:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(80, 97, 197, 0.15);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--dark_grey);
  font-family: Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  padding: 4px 0;
  resize: none;
  min-height: 20px;
  max-height: 60px;
  outline: none;
}

.chat-input::placeholder {
  color: #999;
}

.chat-send-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--dark_blue) 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s, opacity 0.2s;
}

.chat-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-send-btn svg {
  width: 16px;
  height: 16px;
}

/* Features Section - Compact */
.section_features {
  background-color: rgba(253, 248, 248, 0.95);
  padding: 25px 0 30px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.feature-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.feature-card:hover {
  transform: scale(1.08);
  z-index: 10;
}

.feature-card:has(+ .feature-card:hover),
.feature-card:hover + .feature-card {
  transform: scale(1.03);
}

.feature-card img {
  width: 100%;
  height: 90px;
  object-fit: cover;
}

.feature-card-body {
  padding: 10px 12px;
}

.feature-card-text {
  font-size: 12px;
  color: var(--dark_grey);
  line-height: 1.35;
  margin: 0;
}

/* Header Adjustments */
.header {
  padding: 8px 0;
}

.top_cell_l,
.top_cellr1,
.top_cellr2 {
  padding: 5px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Large Desktop (1920+) */
@media screen and (min-width: 1920px) {
  .chat-widget {
    max-width: 400px;
    height: 380px;
  }

  .feature-card img {
    height: 110px;
  }

  .hero-with-bg {
    padding: 30px 0 40px;
  }
}

/* Standard Desktop (1366-1919) */
@media screen and (min-width: 1366px) and (max-width: 1919px) {
  .chat-widget {
    max-width: 360px;
    height: 340px;
  }

  .feature-card img {
    height: 90px;
  }
}

/* Small Desktop / Large Laptop (1024-1365) */
@media screen and (min-width: 1024px) and (max-width: 1365px) {
  .chat-widget {
    max-width: 320px;
    height: 300px;
  }

  .cell_left .heading {
    font-size: 1.6rem;
  }

  .feature-card img {
    height: 75px;
  }

  .feature-card-text {
    font-size: 11px;
  }

  .hero-with-bg {
    padding: 15px 0 25px;
  }

  .section_features {
    padding: 20px 0 25px;
  }
}

/* Tablet Landscape (768-1023) */
@media screen and (max-width: 1023px) {
  .grid_hero {
    grid-template-columns: 1fr;
    gap: 15px;
    text-align: center;
  }

  .cell_left {
    padding-right: 0;
  }

  .cell_left .heading {
    font-size: 1.5rem;
  }

  .sell_right {
    justify-content: center;
  }

  .chat-widget {
    max-width: 400px;
    height: 280px;
  }

  .hero-with-bg {
    padding: 15px 0 20px;
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .feature-card:nth-child(4),
  .feature-card:nth-child(5) {
    grid-column: auto;
  }

  .section_features {
    padding: 15px 0 20px;
  }
}

/* Tablet Portrait (600-767) */
@media screen and (max-width: 767px) {
  .chat-widget {
    max-width: 100%;
    height: 260px;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-card:nth-child(5) {
    grid-column: span 2;
  }

  .feature-card img {
    height: 80px;
  }

  .header .quick-stack {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .top_cellr1,
  .top_cellr2 {
    flex: 0 0 auto;
  }

  .top_cellr1 .btn,
  .top_cellr2 .btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* Mobile (479 and below) */
@media screen and (max-width: 479px) {
  .hero-with-bg {
    padding: 10px 0 15px;
  }

  .cell_left .heading {
    font-size: 1.3rem;
  }

  .chat-widget {
    height: 240px;
    border-radius: 10px;
  }

  .chat-header {
    padding: 8px 10px;
  }

  .chat-avatar {
    width: 28px;
    height: 28px;
  }

  .chat-name {
    font-size: 13px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .feature-card:nth-child(5) {
    grid-column: span 1;
  }

  .feature-card {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .feature-card img {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
  }

  .feature-card-body {
    padding: 8px 10px;
  }

  .section_features {
    padding: 12px 0 15px;
  }

  .header .image-3 {
    width: 120px;
  }

  .header .quick-stack {
    padding: 0 10px;
  }
}

/* Very Small Mobile (375 and below) */
@media screen and (max-width: 375px) {
  .cell_left .heading {
    font-size: 1.15rem;
  }

  .chat-widget {
    height: 220px;
  }

  .message-content {
    font-size: 12px;
    padding: 6px 10px;
  }

  .chat-input {
    font-size: 12px;
  }

  .feature-card img {
    width: 70px;
    height: 50px;
  }

  .feature-card-text {
    font-size: 11px;
  }
}

/* Height-based adjustments for laptops */
@media screen and (max-height: 768px) and (min-width: 1024px) {
  .hero-with-bg {
    padding: 10px 0 20px;
  }

  .chat-widget {
    height: 280px;
  }

  .section_features {
    padding: 15px 0 20px;
  }

  .feature-card img {
    height: 70px;
  }

  .header {
    padding: 5px 0;
  }
}

@media screen and (max-height: 700px) and (min-width: 1024px) {
  .hero-with-bg {
    padding: 8px 0 15px;
  }

  .chat-widget {
    height: 250px;
  }

  .section_features {
    padding: 10px 0 15px;
  }

  .feature-card img {
    height: 60px;
  }

  .feature-card-body {
    padding: 6px 10px;
  }
}

/* Register Prompt Message */
.chat-message.register-prompt .message-content {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  color: #92400e;
}

.chat-message.register-prompt .message-content a {
  color: #d97706;
  font-weight: 600;
  text-decoration: underline;
}

.chat-message.register-prompt .message-content a:hover {
  color: #b45309;
}
