/* Scandinavian Minimalist Chat Interface - Clean Layout */

:root {
  /* Minimalist color palette */
  --cl-accent: #0071e3;
  --background-app: #f5f5f7;
  --background-container: #ffffff;
  --background-sidebar: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #d2d2d7;
  --border-light: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.12);

  /* Shadows */
  --shadow-sidebar: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-container: 0 2px 16px rgba(0, 0, 0, 0.06);

  /* Border radius */
  --radius: 24px;
  --radius-large: 32px;

  /* Spacing */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  align-items: center;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--background-app);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  padding: 0;
  height: 100vh;
  margin: 0;
}

.app-container {
  display: flex;
  height: calc(100vh - (2 * var(--space-lg)));
  width: calc(100% - (2 * var(--space-lg)));
  max-width: 1920px;
  max-height: 1080px;
  background: transparent; /* outer app area no longer a single box */
  position: relative;
  padding: 0;
  gap: 1rem; /* requested spacing between containers */
  margin: auto auto;
}

/* Left outer chat container */
.chat-shell {
  display: flex;
  background: var(--background-container);
  border-radius: var(--radius-large);
  overflow: hidden;
  box-shadow: var(--shadow-container);
  position: relative;
  padding: var(--space-md);
  gap: var(--space-md);
  flex: 1;
  min-width: 0;
  transform-origin: center;
  will-change: transform, opacity;
  /* Initial animation state */
  opacity: 0;
  transform: translateY(20px) scale(0.95);
}

/* Sidebar - Properly positioned with exact spacing */
.sidebar {
  width: 260px;
  height: 100%;
  background: var(--background-sidebar);
  border-radius: var(--radius);
  margin: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sidebar);
  z-index: auto;
  position: relative;
  flex-shrink: 0;
}

.sidebar-header {
  padding: var(--space-md) var(--space-xl);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0;
}

.sidebar-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-lg);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.25s ease;
  margin-bottom: var(--space-xs);
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(0, 113, 227, 0.1);
  color: var(--cl-accent);
}

.nav-item.active {
  background: var(--cl-accent);
  color: white;
}

.nav-item i {
  width: 16px;
  text-align: center;
  font-size: 14px;
}

.sidebar-footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.back-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  border-radius: var(--space-xs);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.25s ease;
}

.back-link:hover {
  color: var(--cl-accent);
}

/* Main Chat Interface - Precise spacing and positioning */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
  height: 100%;
  overflow: visible;
  min-width: 0; /* Prevents flex item from growing beyond container */
}

/* Right Profile Panel */
/* Right outer profile container */
.profile-shell {
  width: 280px;
  background: var(--background-container);
  border-radius: var(--radius-large);
  overflow: hidden;
  box-shadow: var(--shadow-container);
  flex-shrink: 0;
  display: flex;
  justify-content: space-around;
  flex-direction: column;
  padding: var(--space-md);
  gap: 1rem;
  transform-origin: center;
  will-change: transform, opacity;
  /* Initial animation state for desktop only */
  opacity: 0;
  transform: translateX(30px) scale(0.98);
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-xs);
}

.profile-header .avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 2px solid var(--border-light);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.profile-header .avatar img {
  width: 140%; /* zoom in */
  height: 140%;
  object-fit: cover;
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: none;
}

.profile-header .name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-header .role {
  font-size: 13px;
  color: var(--text-secondary);
}

.profile-header .headline {
  font-size: 12px;
  color: var(--text-secondary);
}

.resume-download {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-lg);
  background: var(--background-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.25s ease;
}

.resume-download:hover {
  background: var(--cl-accent);
  color: #fff;
  border-color: transparent;
}

.card-section {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.25s ease;
}

.contact-list li {
  display: block;
  font-size: 14px;
  margin: 0;
  padding: 0;
  transition: all 0.25s ease;
}

.contact-list .contact-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.25s ease;
  border-radius: 8px;
  padding: 8px 0;
}

.contact-list .contact-row i {
  width: 18px; /* fixed icon column for alignment */
  text-align: center;
  flex: 0 0 18px;
  transition: all 0.25s ease;
}

.contact-list li:hover a,
.contact-list li:hover i,
.contact-list li:hover span,
.contact-list li:focus-within a,
.contact-list li:focus-within i,
.contact-list li:focus-within span,
.contact-list li:hover .contact-row,
.contact-list li:focus-within .contact-row {
  color: var(--cl-accent);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-list li {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cl-accent);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px; /* slightly smaller */
  color: #ffffff;
  white-space: nowrap; /* size to text */
}

.chat-header {
  background: transparent;
  padding: 0 0 var(--space-md) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  height: 30px; /* Fixed header height */
}

.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  margin-right: var(--space-sm);
}

.hamburger-btn:hover {
  background: var(--background-app);
  color: var(--cl-accent);
}

.chat-header-info h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.chat-status {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  max-width: 8px;
  max-height: 8px;
  min-width: 8px;
  min-height: 8px;
  border-radius: 50%;
  background: #34c759;
  transform-origin: center;
}

.chat-actions {
  display: flex;
  gap: var(--space-xs);
}

.action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
  font-size: 16px;
  position: relative;
  overflow: hidden;
}

.action-btn:hover {
  background: var(--background-app);
  color: var(--cl-accent);
}

/* Delete button specific styling */
.delete-btn {
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.delete-btn .delete-text {
  position: absolute;
  right: 12px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  pointer-events: none;
}

/* Delete confirmation expanded state */
.delete-btn.confirming {
  width: 84px;
  border-radius: 16px;
  background: #ff3b30;
  color: white;
  padding: 0 12px 0 8px;
  justify-content: flex-start;
}

.delete-btn.confirming:hover {
  background: #d70015;
  color: white;
}

.delete-btn.confirming .delete-text {
  opacity: 1;
  transform: translateX(0);
}

.delete-btn.confirming i {
  margin-right: 8px;
}

/* Delete success flash animation */
.delete-btn.deleting {
  background: #d70015;
  transform: scale(0.95);
}

/* Chat Container - Exact height calculations */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0; /* Allows flex shrinking */
  position: relative; /* For positioning scroll indicator */
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: visible;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-sm) 0 var(--space-sm);
  min-height: 0; /* Allows flex shrinking */
  max-width: 860px;
  z-index: 1;
}

/* Welcome Message - Properly centered without affecting layout */
.welcome-message {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 10% var(--space-sm) var(--space-xl);
  margin: 0;
  min-height: 200px; /* Minimum space for welcome message */
}

.welcome-message h3 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm) 0;
}

.welcome-message p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 var(--space-lg) 0;
  max-width: 450px;
  /* Initially hidden for animation */
  opacity: 0;
  transform: translateY(20px);
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: center;
  /* Initially hidden for animation */
  opacity: 0;
  transform: translateY(20px);
  max-width: 600px;
  white-space: nowrap;
}

.suggestion-chip {
  padding: var(--space-xs) var(--space-md);
  background: var(--background-app);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.25s ease;
  font-weight: 500;
  transform-origin: center;
  will-change: transform;
}

.suggestion-chip:hover {
  background: var(--cl-accent);
  color: white;
  border-color: var(--cl-accent);
}

/* Chat Messages - Precise spacing and alignment */
.message {
  display: flex;
  margin: 0 0 var(--space-md) 0;
  align-items: flex-start;
  padding: 0 var(--space-sm);
}

.message.user {
  justify-content: flex-end;
}

.message.ai {
  justify-content: flex-start;
}

.message-content {
  max-width: 75%;
  padding: var(--space-sm) var(--space-md);
  font-size: 15px;
  line-height: 1.75; /* Improved readability */
  /* Robust wrapping to avoid horizontal scroll */
  word-wrap: break-word; /* legacy */
  overflow-wrap: anywhere; /* modern */
  word-break: break-word;
  margin: 0;
  transition: all 0s;
}

.message.user .message-content {
  background: var(--cl-accent);
  color: white;
  border-radius: 18px 18px 4px 18px;
}

.message.ai .message-content {
  /* Seamless look: no bubble background */
  background: transparent;
  color: var(--text-primary);
  border-radius: 0;
  max-width: 90%;
}

/* Markdown spacing and indentation inside AI messages */
.message.ai .message-content p {
  margin: 0.35rem 0; /* space between paragraphs */
}

.message.ai .message-content ul,
.message.ai .message-content ol {
  margin: 0.35rem 0 0.35rem 0; /* vertical rhythm */
  padding-left: 1.25rem; /* indent bullets */
  list-style-position: outside; /* bullets outside for clean alignment */
}

/* Tighten spacing for list item paragraphs and nested lists */
.message.ai .message-content li > p {
  margin: 0.2rem 0; /* reduce gap between bullet text and nested content */
}
.message.ai .message-content li ul,
.message.ai .message-content li ol {
  margin: 0.2rem 0 0.2rem 1rem; /* slightly tighter nested list spacing */
}

.message.ai .message-content li {
  margin: 0.25rem 0; /* space between bullets */
}

.message.ai .message-content code {
  background: var(--background-app);
  padding: 0 0.25em;
  border-radius: 4px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Wrap code blocks and long inline content */
.message-content pre {
  white-space: pre-wrap; /* wrap long lines in code blocks */
  word-break: break-word;
  overflow-wrap: anywhere;
}

.message-content a {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Typing Indicator - Properly positioned */
.typing-message {
  padding: 0 var(--space-sm);
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  /* slightly larger container */
  padding: var(--space-md) var(--space-md);
  background: var(--background-app);
  border-radius: 18px 18px 18px 4px;
  max-width: fit-content;
  margin: 0;
}

.typing-dots {
  display: flex;
  /* a bit more space between dots */
  gap: 5px;
}

.typing-dot {
  /* slightly larger dots */
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: typingPulse 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.chat-input-container {
  padding: 0;
  /* allow growth: floor, not ceiling */
  min-height: 45px;
  z-index: 2;
}

@keyframes typingPulse {
  0%,
  80%,
  100% {
    opacity: 0.3;
  }
  40% {
    opacity: 1;
  }
}

/* Chat Input - Fixed positioning with precise spacing */
.chat-input-container {
  padding: 0 var(--space-xs);
  flex-shrink: 0;
  background: transparent;
  height: auto;
  margin: 0 0 0.15rem 0;
}

/* Hide profile panel and expand chat on medium screens */
@media (max-width: 1050px) {
  .profile-shell {
    display: none;
  }

  .chat-shell {
    flex: 1 1 auto;
    width: 100%;
    /* Reset animation state for medium screens where profile is hidden */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

.chat-form {
  width: 100%;
  margin: 0;
  padding: 0;
}

.input-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0 8px 0 var(--space-md);
  margin: 0 auto;
  background: var(--background-app);
  border-radius: 1.5rem;
  transition: all 0.25s ease;
  min-height: 44px;
  max-width: 800px;
  justify-content: flex-end;
  align-items: flex-end;
}

.input-wrapper:focus-within {
  background: white;
  /* use inset ring on all sizes to avoid clipping */
  box-shadow: inset 0 0 0 2px var(--cl-accent);
}

#chat-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  resize: none;
  line-height: 1.5;
  min-height: 50px;
  max-height: 200px; /* ~4 lines at 20px line height */
  overflow-y: auto;
  padding: 14px 0px 0;
  margin: 0;
}

#chat-input::placeholder {
  color: var(--text-secondary);
}

.send-button {
  width: 40px;
  height: 40px;
  margin-bottom: 5px;
  margin-right: -2px;
  border: none;
  border-radius: 50%;
  background: var(--cl-accent);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
  font-size: 12px;
}

.send-button:hover {
  background: #0056b3;
}

.send-button:disabled {
  background: var(--text-tertiary);
  cursor: not-allowed;
}

.send-button i {
  font-size: 16px;
}

/* Responsive Design - Precise mobile spacing */
@media (max-width: 768px) {
  body {
    padding: 0;
    height: 100svh; /* prevent jump when keyboard opens */
  }

  .app-container {
    height: calc(100svh - var(--space-sm));
    width: calc(100vw + var(--space-sm));
    flex-direction: column;
    margin: var(--space-sm);
  }

  /* Off-canvas layout */
  .profile-shell {
    display: none; /* Hide profile panel on small screens */
  }

  .chat-shell {
    position: relative;
    padding: var(--space-sm);
    overflow: hidden;
    max-height: calc(100lvh - 1rem);
    /* ensure some bottom space so focus ring and layout have room */
    padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom));
    /* container should not transform to avoid affecting fixed sidebar positioning */
  }

  .chat-input-container {
    /* keep anchored at the very bottom without extra gap to prevent drift */
    margin-bottom: 0;
    background: transparent;
  }

  #chat-input {
    font-size: 16px;
    padding: 12px 4px 0;
  }

  .message.ai .message-content {
    max-width: 98%;
    padding: 0.25rem;
  }

  .hamburger-btn {
    display: inline-flex; /* show hamburger on small screens */
  }

  /* Sidebar becomes off-canvas panel */
  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: min(78vw, 320px);
    margin: 0;
    min-height: calc(100% + 4px);
    transform: translateX(-110%);
    margin-top: -6px !important;
    transition: transform 0.25s ease;
    z-index: 1100; /* above chat content while open */
  }

  /* When app is toggled open, slide sidebar in and shift chat */
  .app-container.menu-open .sidebar {
    transform: translateX(0);
  }

  /* removed empty .input-wrapper ruleset */

  /* Shift the chat-shell left to reveal more space */
  /* smoothly slide only the chat content */
  .chat-main {
    transition: transform 0.25s ease;
    padding: 0.25rem 0 !important;
  }

  .chat-header {
    padding: 1rem 0 1.25rem;
  }

  .chat-header p {
    font-size: 14px !important;
  }

  .chat-header i {
    font-size: 18px !important;
  }
  #sidebar-toggle {
    margin-left: 4px;
  }

  .app-container.menu-open .chat-main {
    transform: translateX(calc(min(78vw, 320px)));
  }

  .chat-main {
    padding: var(--space-sm);
    flex: 1;
    overflow: hidden;
    min-height: 0;
    max-height: 100svh; /* cap at large viewport height */
  }

  .message {
    padding: 0 var(--space-xs);
  }

  .welcome-message {
    max-width: 90%;
    margin: 0 auto;
  }

  .welcome-message p {
    max-width: 90%;
  }

  .chat-messages {
    max-height: calc(
      100svh - 140px
    ); /* leave room for header + input on mobile */
    /* prevent smooth scrolling/anchor from nudging layout during textarea resize */
    scroll-behavior: auto;
    overflow-anchor: none;
    padding-left: 0;
    padding-right: 0;
  }

  .sidebar-header {
    padding: var(--space-lg) var(--space-lg) var(--space-md);
    border-bottom: 1px solid var(--border-medium);
  }
}

/* Scrollbar Styling - Clean and minimal */
.chat-messages::-webkit-scrollbar,
#chat-input::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.chat-messages::-webkit-scrollbar-track,
#chat-input::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb,
#chat-input::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
#chat-input::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Smooth scroll behavior */
.chat-messages {
  scroll-behavior: smooth;
}

/* Project Cards Styles */
.project-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
  max-width: 100%;
}

.project-card {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  background: var(--background-container);
  background-size: cover;
  background-position: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 2px solid var(--border-light);
  aspect-ratio: 16 / 10;
  width: 100%; /* Remove max-width constraint to allow scaling */
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.project-card-image {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-card-image img {
  transform: scale(1.05);
}

.project-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  padding: 2rem 1.5rem 1.5rem;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-card-overlay {
  transform: translateY(0);
}

.project-card-title {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.project-card-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .project-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin: 0.75rem 0;
  }

  .project-card {
    aspect-ratio: 4 / 3;
    border-width: 1px;
    max-width: none; /* Remove max width constraint */
  }

  /* Show overlay always on mobile */
  .project-card-overlay {
    transform: translateY(0);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 1.5rem 1rem 1rem;
  }

  .project-card-title {
    font-size: 0.9rem;
  }

  .project-card-subtitle {
    font-size: 0.8rem;
  }
}

/* Tablet responsive adjustments */
@media (min-width: 769px) and (max-width: 1199px) {
  .project-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }
}

/* For small mobile screens - maintain responsive columns */
@media (max-width: 480px) {
  .project-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
  }

  .project-card {
    max-width: none; /* Allow cards to scale down with grid */
  }

  .project-card-overlay {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    padding: 1rem 0.75rem 0.75rem;
  }

  .project-card-title {
    font-size: 0.8rem;
    line-height: 1.2;
  }

  .project-card-subtitle {
    font-size: 0.7rem;
    line-height: 1.2;
  }
}

/* For larger screens, maintain responsive columns */
@media (min-width: 1200px) {
  .project-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    justify-content: start;
  }
}

/* Scroll Down Indicator */
.chat-scroll-indicator {
  position: absolute;
  bottom: 60px;
  right: 50%;
  transform: translateX(50%);
  width: 36px;
  height: 36px;
  background: var(--text-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.25s ease;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.chat-scroll-indicator i {
  font-size: 16px !important;
  color: white;
}

.chat-scroll-indicator.visible {
  opacity: 0.75;
}

.chat-scroll-indicator i {
  font-size: 20px;
  color: white;
}

.chat-scroll-indicator:hover {
  background: #656569;
}
