/* ============================================
   MODERN PORTFOLIO CHAT INTERFACE
   Professional Design System
   Warm Sunset Theme
   ============================================ */

/* CSS Variables for Theme */
:root {
  /* Warm Sunset Color Palette - Energetic & Friendly */
  --bg-primary: #0c0a09;
  --bg-secondary: #1c1917;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --text-primary: #fafaf9;
  --text-secondary: #d6d3d1;
  --text-muted: #a8a29e;
  --accent-primary: #f97316;
  --accent-secondary: #eab308;
  --accent-gradient: linear-gradient(135deg, #f97316 0%, #eab308 100%);
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 30px rgba(249, 115, 22, 0.4);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
}

/* Dark Mode (default) */
body.dark-mode {
  --bg-primary: #0c0a09;
  --bg-secondary: #1c1917;
  --text-primary: #fafaf9;
  --text-secondary: #d6d3d1;
}

/* Light Mode */
body:not(.dark-mode) {
  --bg-primary: #fffbeb;
  --bg-secondary: #ffffff;
  --bg-card: rgba(0, 0, 0, 0.02);
  --bg-card-hover: rgba(0, 0, 0, 0.05);
  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #78716c;
  --accent-primary: #ea580c;
  --accent-secondary: #ca8a04;
  --accent-gradient: linear-gradient(135deg, #ea580c 0%, #ca8a04 100%);
  --border-color: rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 30px rgba(234, 88, 12, 0.3);
}

/* ============================================
   BASE STYLES
   ============================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  position: relative;
}

/* Animated Background Gradient - Warm Sunset */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 30%, rgba(249, 115, 22, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(234, 179, 8, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(239, 68, 68, 0.08) 0%, transparent 40%),
    var(--bg-primary);
  z-index: -1;
  animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* Floating Orbs - Warm Colors */
body::after {
  content: '';
  position: fixed;
  top: 10%;
  right: 10%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  animation: floatOrb1 15s ease-in-out infinite;
  pointer-events: none;
}

@keyframes floatOrb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-50px, 30px) scale(1.1); }
  50% { transform: translate(-20px, -40px) scale(0.9); }
  75% { transform: translate(30px, 20px) scale(1.05); }
}

/* ============================================
   MODAL & CONTAINER
   ============================================ */

.modal {
  display: flex;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 2.5%;
  overflow: hidden;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1400px;
  height: 100%;
  max-height: 95vh;
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUp 0.5s ease-out;
}

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

/* ============================================
   HEADER SECTION
   ============================================ */

.header-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.welcome-message {
  text-align: center;
}

.greeting-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  animation: fadeIn 0.6s ease-out;
}

.greeting-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 600px;
  margin: 0 auto;
}

.example-text {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

/* ============================================
   PROFILE CARD
   ============================================ */

.profile-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  flex: 1;
  min-width: 240px;
}

.profile-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.profile-photo-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-photo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.status-indicator {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid var(--bg-secondary);
  border-radius: var(--radius-full);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.profile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-info h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.profile-divider {
  color: var(--text-muted);
  font-size: 0.9rem;
  opacity: 0.5;
}

.profile-role {
  color: var(--accent-primary);
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.2;
}

.profile-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-location {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.social-link:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.social-link svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   THEME TOGGLE
   ============================================ */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.theme-toggle svg {
  position: absolute;
  transition: all var(--transition-base);
}

.sun-icon {
  opacity: 1;
  transform: rotate(0deg);
}

.moon-icon {
  opacity: 0;
  transform: rotate(90deg);
}

body:not(.dark-mode) .sun-icon {
  opacity: 0;
  transform: rotate(90deg);
}

body:not(.dark-mode) .moon-icon {
  opacity: 1;
  transform: rotate(0deg);
}

/* ============================================
   CHAT SECTION
   ============================================ */

.chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  overflow: hidden;
  min-height: 0;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-sm);
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chat-history::-webkit-scrollbar {
  width: 6px;
}

.chat-history::-webkit-scrollbar-track {
  background: transparent;
}

.chat-history::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

.chat-history::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Light mode background gradient */
body:not(.dark-mode)::before {
  background:
    radial-gradient(circle at 20% 30%, rgba(234, 88, 12, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(202, 138, 4, 0.08) 0%, transparent 50%),
    var(--bg-primary);
}

/* ============================================
   WELCOME HERO SECTION
   ============================================ */

.chat-welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--spacing-md);
  transition: all var(--transition-base);
}

.welcome-hero {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  max-width: 600px;
  width: 100%;
}

.welcome-image {
  position: relative;
  flex-shrink: 0;
  width: 140px;
  height: 140px;
}

.welcome-image img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-xl);
  object-fit: cover;
  border: 3px solid var(--accent-primary);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-base);
}

.welcome-image:hover img {
  transform: scale(1.02);
}

.image-glow {
  position: absolute;
  inset: -10px;
  background: var(--accent-gradient);
  border-radius: var(--radius-xl);
  opacity: 0.3;
  filter: blur(20px);
  z-index: -1;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.05); }
}

.welcome-content {
  flex: 1;
  text-align: left;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-full);
  color: #22c55e;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: var(--spacing-sm);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.welcome-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  line-height: 1.2;
}

.welcome-name span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-tagline {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent-primary);
  margin: 0 0 var(--spacing-sm) 0;
}

.welcome-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Responsive welcome hero */
@media (max-width: 600px) {
  .welcome-hero {
    flex-direction: column;
    text-align: center;
  }

  .welcome-content {
    text-align: center;
  }

  .welcome-image {
    width: 120px;
    height: 120px;
  }

  .welcome-name {
    font-size: 1.5rem;
  }
}

/* Suggestion Chips */
.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  justify-content: center;
  padding: var(--spacing-sm);
  border-top: 1px solid var(--border-color);
  transition: all var(--transition-base);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.chip:hover {
  background: rgba(249, 115, 22, 0.1);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.chip:active {
  transform: translateY(0);
}

.chip-icon {
  font-size: 0.9rem;
}

/* ============================================
   MESSAGES
   ============================================ */

.chat-message {
  margin-bottom: var(--spacing-md);
  opacity: 0;
  animation: fadeInUp 0.4s ease-out forwards;
}

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

.message-content {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  max-width: 75%;
  word-wrap: break-word;
  line-height: 1.5;
}

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

.user-message .message-content {
  background: var(--accent-gradient);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: var(--shadow-sm);
}

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

.ai-message .message-content {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.error-message .message-content {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.typing-indicator {
  font-style: normal;
}

.typing-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.typing-indicator .dot {
  display: inline-block;
  animation: blink 1.4s infinite both;
  margin-left: 2px;
}

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

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

@keyframes blink {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.resume-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.resume-link:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

/* ============================================
   INPUT SECTION
   ============================================ */

.input-section {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  flex-shrink: 0;
}

.input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 var(--spacing-sm);
  transition: all var(--transition-base);
}

.input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#userInput {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}

#userInput::placeholder {
  color: var(--text-muted);
}

.voice-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.voice-button:hover {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
}

.voice-button:active {
  transform: scale(0.95);
}

.search-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--accent-gradient);
  border: none;
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.search-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.search-button:active {
  transform: translateY(0);
}

.search-button svg {
  flex-shrink: 0;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.action-buttons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: inherit;
}

.action-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.action-btn:active {
  transform: translateY(0);
}

.action-btn svg {
  flex-shrink: 0;
}

.resume-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.portfolio-btn:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .modal {
    padding: 2.5%;
  }
  
  .modal-content {
    padding: var(--spacing-sm);
    border-radius: var(--radius-lg);
    max-height: 95vh;
  }
  
  .greeting-title {
    font-size: 1.5rem;
  }
  
  .greeting-text {
    font-size: 0.85rem;
  }
  
  .header-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .profile-card {
    min-width: 100%;
    padding: var(--spacing-sm);
  }
  
  .profile-name-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .profile-divider {
    display: none;
  }
  
  .profile-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .message-content {
    max-width: 85%;
  }
  
  .input-section {
    flex-wrap: wrap;
  }
  
  .input-wrapper {
    width: 100%;
  }
  
  .search-button {
    width: 100%;
    justify-content: center;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .action-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .greeting-title {
    font-size: 1.25rem;
  }
  
  .profile-info h2 {
    font-size: 1rem;
  }
  
  .profile-name-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .profile-divider {
    display: none;
  }
  
  .profile-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .message-content {
    max-width: 90%;
    font-size: 0.9rem;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
