:root {
  --bg: #fefefe;
  --text: #1f2e3d;
  --primary: #009688;
  --primary-dark: #00796b;
  --accent: #004d40;
  --section-bg: #e0f2f1;
  --white: #fff;
  --gray: #ccc;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --radius: 10px;
  --transition: 0.3s ease;
}

/* Dark mode overrides */
:root.dark {
  --bg: #1c1c1e;
  --text: #e0e0e0;
  --primary: #00c6a9;
  --primary-dark: #00796b;
  --accent: #80cbc4;
  --section-bg: #2a2a2e;
  --white: #1e1e1e;
  --gray: #555;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Base styles */
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.7;
  scroll-behavior: smooth;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', sans-serif;
}

h1 {
  font-size: 2.4rem;
  font-weight: 700;
}

h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

.container {
  width: 90%;
  max-width: 1000px;
  margin: auto;
  padding: 2rem 1rem;
}

/* Header */
.header {
  background: var(--primary);
  color: var(--white);
  padding: 2.5rem 0;
  box-shadow: var(--shadow);
}

.header-flex {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.profile-pic {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.profile-pic:hover {
  transform: scale(1.05);
}

.header-text h1 {
  margin: 0;
  font-size: 2.3rem;
  letter-spacing: -0.5px;
}

.subtitle {
  margin: 0.3rem 0;
  font-weight: 400;
  font-size: 1.1rem;
  color: #d1fffb;
}

.tech-stack {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* Skills */
.skills-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  padding: 0;
}

.skills-list li {
  background: var(--white);
  border: 1px solid var(--gray);
  padding: 0.6rem 1rem;
  text-align: center;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.skills-list li:hover {
  background: var(--primary-dark);
  color: var(--white);
  transform: translateY(-2px);
}

/* Projects */
.project, .project-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 5px solid var(--primary);
  transition: var(--transition);
}

.project:hover, .project-card:hover {
  transform: scale(1.015);
}

.project-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.project-card p {
  font-size: 0.95rem;
  color: #444;
}

/* Clients */
.clients {
  background: var(--section-bg);
}

.client-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.client-logos img {
  width: 100px;
  filter: grayscale(100%);
  transition: var(--transition);
  opacity: 0.8;
}

.client-logos img:hover {
  filter: none;
  transform: scale(1.08);
  opacity: 1;
}

/* CTA */
.cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  text-align: center;
  padding: 5rem 2rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.cta h2 {
  margin: 0 0 1rem;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  animation: floatIn 0.8s ease-out forwards;
}

.cta p {
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  opacity: 0.95;
  animation: fadeIn 1.2s ease-out forwards;
}

.cta-button {
  background: var(--white);
  color: var(--primary-dark);
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  text-decoration: none;
  transition: transform 0.3s ease, background 0.3s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.cta-button:hover {
  background: #dffbf9;
  transform: scale(1.05);
}

.cta-button.small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 0.9rem;
  padding: 1.5rem 1rem;
  background: #f4f4f4;
  color: #666;
}

/* Chat Layout */
.ai-chat-section {
  width: 100%;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: var(--white);
  border-radius: var(--radius);
  border: 1px solid #ddd;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.03);
}

.ai-chat-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.chat-sidebar {
  flex: 1;
  max-width: 180px;
  background: var(--white);
  border: 1px solid #eee;
  padding: 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 2rem;
  height: fit-content;
}

.profile-sidebar-pic {
  width: 100%;
  max-width: 120px;
  border-radius: 50%;
  margin-bottom: 1rem;
  border: 3px solid #ddd;
}

.chat-main {
  flex: 5;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

/* Chat Messages */
.chat-log {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-line;
  background: #fff;
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #ddd;
}

.chat-bubble {
  display: flex;
  margin-bottom: 12px;
  align-items: flex-end;
}

.chat-bubble.user {
  justify-content: flex-end;
}

.chat-bubble.assistant {
  justify-content: flex-start;
}

.bubble {
  max-width: 80%;
  padding: 10px 15px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.4;
  background-color: #f0f0f0;
}

.chat-bubble.user .bubble {
  background-color: #b2dfdb;
  color: #00332f;
  border-bottom-right-radius: 0;
}

.chat-bubble.assistant .bubble {
  background-color: #eeeeee;
  color: #000;
  border-bottom-left-radius: 0;
}

.ai-response {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #888;
  font-style: italic;
}

/* Chat Input */
.chat-input-area {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  background-color: #f9f9f9;
  border-top: 1px solid #eee;
}

#projectInput {
  flex: 1;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--gray);
  border-radius: var(--radius);
  resize: vertical;
  font-family: 'Inter', sans-serif;
}

#projectInput:focus {
  border-color: var(--primary);
  outline: none;
}

#submitProject {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  background-color: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

#submitProject:hover {
  background-color: var(--primary-dark);
}

/* Animations */
@keyframes floatIn {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .profile-pic {
    width: 100px;
    height: 100px;
  }

  .header-text h1 {
    font-size: 1.8rem;
  }

  .skills-list {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }

  .client-logos img {
    width: 80px;
  }
}

@media (max-width: 480px) {
  h2 {
    font-size: 1.5rem;
  }

  .cta h2 {
    font-size: 1.6rem;
  }

  .cta-button {
    font-size: 0.95rem;
    padding: 0.6rem 1.2rem;
  }
}

/* Theme Toggle Button */
.theme-toggle {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 1.2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.2s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}
