/* Base styles */
.gradient-text {
    background: linear-gradient(90deg, #4F46E5, #2563EB);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Add scroll margin for sections */
section[id] {
    scroll-margin-top: 4rem; /* This accounts for the navbar height (4rem/64px) plus some extra space */
}

/* Patterns and backgrounds */
.circuit-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(90deg, rgba(52, 211, 153, 0.1) 1px, transparent 1px),
        linear-gradient(rgba(52, 211, 153, 0.1) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.5;
}

.circuit-pattern-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(90deg, rgba(52, 211, 153, 0.1) 1px, transparent 1px),
        linear-gradient(rgba(52, 211, 153, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
}

/* Enhanced project cards with modern effects */
.project-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(39, 99, 235, 0.1);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.project-card:hover {
    transform: translateY(-5px) scale(1.01);
    border-color: rgba(39, 99, 235, 0.3);
    box-shadow: 0 10px 25px rgba(39, 99, 235, 0.15);
}

.project-card:hover::before {
    left: 100%;
}

/* Hero section */
.hero-section {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    background-color: #1a1a2e;
    color: white;
}

/* Enhanced animations */
.floating {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Subtle fade-in animations for sections */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

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

/* Enhanced button hover effects */
.btn-enhanced {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-enhanced::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.btn-enhanced:hover::before {
    width: 300px;
    height: 300px;
}

/* Enhanced stats cards */
.stats-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Modern focus states */
a:focus-visible, button:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
    border-radius: 4px;
}

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

/* Navigation styles */
.nav-dark {
    background-color: #1a1a2e;
    border-bottom: 1px solid rgba(79, 70, 229, 0.1);
}

.nav-dark a {
    color: #cbd5e1;
}

.nav-dark a:hover {
    color: white;
}

.nav-light {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
}

.nav-light a {
    color: #4b5563;
}

.nav-light a:hover {
    color: #1a1a2e;
}

.nav-light .logo-text {
    color: #1a1a2e;
}

/* Mobile menu animations */
.menu-animation {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.menu-closed {
    max-height: 0;
    opacity: 0;
}

.menu-open {
    max-height: 300px;
    opacity: 1;
}

/* Mobile menu themes */
.mobile-menu-dark {
    background-color: #1a1a2e;
    color: #cbd5e1;
}

.mobile-menu-dark a:hover {
    color: white;
}

.mobile-menu-light {
    background-color: #fff;
    color: #4b5563;
}

.mobile-menu-light a:hover {
    color: #1a1a2e;
}

/* Chat-specific styles */

/* Message bubbles - consolidated */
.user-bubble {
    background-color: rgba(209, 250, 229, 0.4);
    color: #1F2937;
    border-radius: 18px 4px 18px 18px;
    border: 1px solid rgba(167, 243, 208, 0.5);
    position: relative;
}
  
.assistant-bubble {
    background-color: rgba(219, 234, 254, 0.4);
    color: #1F2937;
    border-radius: 4px 18px 18px 18px;
    border: 1px solid rgba(191, 219, 254, 0.5);
    position: relative;
}
  
/* Animation for typing indicator */
@keyframes thinking {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
  
.thinking-dots {
    animation: thinking 1.5s infinite;
    padding-left: 0.5rem;
}

/* Chat UI elements */
#chat-bubble {
    transition: background-color 0.3s ease;
}

#chat-bubble:hover {
    background-color: #2563eb;
}
  
#chat-panel {
    transition: all 0.3s ease;
    max-height: 80vh;
    width: 30rem;
    border-radius: 10px;
    overflow: hidden;
}
  
/* Custom scrollbar for chat - consolidated */
#chat-messages::-webkit-scrollbar,
#mini-chat-messages::-webkit-scrollbar {
    width: 4px;
}
  
#chat-messages::-webkit-scrollbar-track,
#mini-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
  
#chat-messages::-webkit-scrollbar-thumb,
#mini-chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}
  
#chat-messages::-webkit-scrollbar-thumb:hover,
#mini-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
  
/* Typography and form styling */
.message-text {
    line-height: 1.5;
}
  
.message-text p {
    margin-bottom: 0.5rem;
}
  
.message-text p:last-child {
    margin-bottom: 0;
}
  
#user-input:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
  
#chat-form button {
    transition: all 0.2s ease;
}
  
#chat-form button:hover {
    transform: translateY(-1px);
}
  
#chat-form button:active {
    transform: translateY(1px);
}
  

  
  @media (max-width: 768px) {
    /* Full-screen chat panel on mobile */
    #chat-panel.mobile-chat-open {
      position: fixed;
      inset: 0; /* top:0; right:0; bottom:0; left:0; */
      display: flex;
      width: 100%;
      height: 100%;
      max-height: 100vh;
      flex-direction: column;
      border-radius: 10;
      z-index: 100;
    }
  
    /* Keep the header pinned at the top via normal flow or sticky */
    #chat-panel.mobile-chat-open .chat-header {
      position: sticky;
      top: 0;
      z-index: 10;
      background-color: #f9fafb; 
    }
  
    /* Let messages flex to fill leftover space */
    #chat-panel.mobile-chat-open #mini-chat-messages {
      flex: 1;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
  
    /* The input area is no longer sticky/fixed in CSS; we reposition in JS */
    #chat-panel.mobile-chat-open .chat-input-area {
      /* remove bottom: 0; remove position: fixed or sticky */
      position: static; 
    }
  
    /* Hide the chat bubble container when the chat is open */
    #chat-bubble-container.hide {
      display: none;
    }
  }
  
  


  
  /* Message formatting */
  .message-text p:last-child {
    margin-bottom: 0;
  }