/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #f1f5f9;
    background-color: #0f172a;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 2rem;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
}

p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Utility Classes */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #0a33ea 0%, #1e40af 100%);
    border-radius: 2px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    position: relative;
    overflow: hidden;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23667eea" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-text {
    text-align: center;
}

.hero-title {
    margin-bottom: 1.5rem;
    color: #f1f5f9;
}


.highlight {
    background: linear-gradient(135deg, #0a33ea 0%, #1e40af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.gradient-text {
    background: linear-gradient(135deg, #0a33ea 0%, #1e40af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero-description {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn::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;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #0a33ea 0%, #1e40af 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #0a33ea;
    border: 2px solid #0a33ea;
}

.btn-secondary:hover {
    background: #0a33ea;
    color: white;
    transform: translateY(-2px);
}

.btn-large {
    padding: 1.25rem 2.5rem;
    font-size: 1.2rem;
}

/* Profile Card */
.profile-card {
    background: #0f172a;
    border-radius: 20px;
    padding: 3.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    transition: all 0.3s ease;
    border: 1px solid #334155;
}

.profile-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 80px rgba(10, 51, 234, 0.2);
    border-color: #0a33ea;
}

/* Impact Card (replaces profile card) */
.impact-card {
    background: #0f172a;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid #334155;
}

.impact-title {
    color: #f1f5f9;
    margin-bottom: 1rem;
    text-align: left;
}

.impact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.impact-item {
    background: #1e293b;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    border: 1px solid #334155;
}

.impact-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0a33ea;
    margin-bottom: 0.25rem;
}

.impact-label {
    display: block;
    font-size: 0.95rem;
    color: #94a3b8;
}

.impact-footnote {
    color: #94a3b8;
    font-size: 0.95rem;
}

@media (max-width: 767px) {
    .impact-grid {
        grid-template-columns: 1fr;
    }
}

.profile-image {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.profile-photo {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    border: 8px solid #0a33ea;
    box-shadow: 0 25px 80px rgba(10, 51, 234, 0.5);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.profile-photo:hover {
    transform: scale(1.08);
    box-shadow: 0 30px 80px rgba(10, 51, 234, 0.6);
    border-color: #1e40af;
}

.profile-photo::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(135deg, #0a33ea 0%, #1e40af 100%);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.profile-photo:hover::before {
    opacity: 0.6;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0a33ea;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Value Proposition */
.value-prop {
    padding: 5rem 0;
    background: #0f172a;
}

.value-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.value-card {
    text-align: center;
    padding: 2rem;
    border-radius: 15px;
    background: #1e293b;
    transition: all 0.3s ease;
    border: 1px solid #334155;
}

.value-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(10, 51, 234, 0.15);
    border-color: #0a33ea;
    background: #0f172a;
}

.value-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #0a33ea 0%, #1e40af 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.value-icon svg {
    width: 30px;
    height: 30px;
}

.value-card h3 {
    margin-bottom: 1rem;
    color: #f1f5f9;
}

.value-card p {
    color: #94a3b8;
    font-size: 1rem;
}

/* Experience Section */
.experience {
    padding: 5rem 0;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #0a33ea 0%, #1e40af 100%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 80px;
}

.timeline-marker {
    position: absolute;
    left: 20px;
    top: 20px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #0a33ea 0%, #1e40af 100%);
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 0 0 4px #0a33ea;
}

.timeline-content {
    background: #0f172a;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid #334155;
}

.timeline-content:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(10, 51, 234, 0.15);
    border-color: #0a33ea;
}

.timeline-header {
    margin-bottom: 1.5rem;
}

.timeline-header h3 {
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.timeline-company {
    color: #0a33ea;
    font-weight: 600;
    font-size: 1.1rem;
}

.timeline-date {
    color: #94a3b8;
    font-size: 0.9rem;
    float: right;
}

.timeline-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.highlight-item {
    text-align: center;
    padding: 1rem;
    background: #1e293b;
    border-radius: 10px;
    min-width: 0; /* Prevent grid item from overflowing */
    overflow: visible; /* Ensure content is not clipped */
    width: 100%; /* Take full width of grid cell */
}

.highlight-number {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0a33ea;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.highlight-number-main {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0a33ea;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.highlight-number-suffix {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #0a33ea;
    margin: 0;
    padding: 0;
    margin-top: -0.1rem;
    line-height: 1;
}

.highlight-text {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Skills Section */
.skills {
    padding: 5rem 0;
    background: #0f172a;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.skill-category {
    background: #1e293b;
    padding: 2rem;
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 1px solid #334155;
}

.skill-category:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(10, 51, 234, 0.15);
    border-color: #0a33ea;
    background: #0f172a;
}

.skill-category h3 {
    color: #f1f5f9;
    margin-bottom: 1.5rem;
    text-align: center;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.skill-tag {
    background: linear-gradient(135deg, #0a33ea 0%, #1e40af 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.3s ease;
}

.skill-tag:hover {
    transform: scale(1.05);
}

/* Education Section */
.education {
    padding: 5rem 0;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.education-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.education-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #0f172a;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid #334155;
}

.education-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(10, 51, 234, 0.15);
    border-color: #0a33ea;
}

.education-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0a33ea 0%, #1e40af 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.education-icon svg {
    width: 30px;
    height: 30px;
}

.education-content h3 {
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.education-school {
    color: #0a33ea;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.education-date {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Contact Section */
.contact {
    padding: 5rem 0;
    background: #0f172a;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

.contact-info {
    text-align: center;
}

.contact-description {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    padding: 1rem;
    background: #0a33ea;
    border-radius: 10px;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 18px rgba(10, 51, 234, 0.18);
}

.contact-item:hover {
    background: #1e40af; /* darker blue on hover to maintain contrast */
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(10, 51, 234, 0.28);
}

/* Ensure contact link and icon remain legible on hover */
.contact-item:hover a {
    color: #ffffff;
}

.contact-item svg {
    color: #ffffff;
}

.contact-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Make contact links look like blue buttons */
.contact-item a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    /*background: linear-gradient(135deg, #0a33ea 0%, #1e40af 100%);*/
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: none; /* remove any glow */
    text-shadow: none; /* ensure no text glow */
}

.contact-item a:hover {
    transform: translateY(-1px);
    box-shadow: none; /* no hover glow */
}

.contact-cta {
    display: flex;
    justify-content: center;
}

.cta-card {
    background: linear-gradient(135deg, #0a33ea 0%, #1e40af 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(10, 51, 234, 0.3);
    transition: all 0.3s ease;
    border: 1px solid #0a33ea;
}

.cta-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 80px rgba(10, 51, 234, 0.4);
    background: linear-gradient(135deg, #1e40af 0%, #0a33ea 100%);
}

.cta-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.cta-card p {
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-card .btn {
    background: #0f172a;
    color: #0a33ea;
    border: none;
}

.cta-card .btn:hover {
    background: #1e293b;
    transform: translateY(-2px);
}

.cta-card .btn svg {
    width: 20px;
    height: 20px;
}

/* Footer */
.footer {
    background: #2c2a2a;
    color: rgb(5, 3, 3);
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    margin: 0;
    opacity: 0.8;
}

/* --- Footer Layout --- */
.footer-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1.5rem 0;
    text-align: center;
  }
  
  /* logo on the left */
  .footer-logo {
    position: absolute;
    left: 2rem;
    width: 85px;
    height: auto;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  
  .footer-logo:hover {
    opacity: 1;
    transform: scale(1.05);
  }
  
  /* copyright text stays centered */
  .footer p {
    margin: 0;
    font-size: 0.95rem;
    color: rgb(255, 255, 255);
  }
  
  /* responsive tweak for smaller screens */
  @media (max-width: 600px) {
    .footer-layout {
      flex-direction: column;
    }
  
    .footer-logo {
      position: static;
      margin-bottom: 0.5rem;
    }
  }  
  

/* Responsive Design */
@media (min-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
    
    .hero-text {
        text-align: left;
    }
    
    .cta-buttons {
        justify-content: flex-start;
    }
    
    .value-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .education-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .contact-info {
        text-align: left;
    }
    
    .contact-details {
        align-items: flex-start;
    }
    
    .contact-item {
        justify-content: flex-start;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 40px;
    }
    
    .hero {
        padding: 0;
    }
    
    .timeline-highlights {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-item {
    animation: fadeInUp 0.6s ease-out;
}

.value-card {
    animation: fadeInUp 0.6s ease-out;
}

.skill-category {
    animation: fadeInUp 0.6s ease-out;
}

.education-item {
    animation: fadeInUp 0.6s ease-out;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
.btn:focus,
.contact-item:focus {
    outline: 2px solid #0a33ea;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .hero {
        background: #0f172a;
    }
    
    .btn {
        background: #0a33ea !important;
        color: white !important;
    }
}

/* Impact Snapshot */
.impact-card{
    background: linear-gradient(180deg, rgba(8,14,26,0.9), rgba(8,14,26,0.95));
    border: 1px solid rgba(64,132,255,0.18);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35), inset 0 0 60px rgba(32,90,255,0.06);
    border-radius: 20px;
    padding: clamp(20px, 3vw, 32px);
    max-width: 560px;
}

.impact-title{
    font-weight: 700;
    font-size: clamp(18px, 2vw, 22px);
    color: #b9c6ff;
    margin: 0 0 16px;
    letter-spacing: 0.2px;
}

.impact-grid{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(12px, 2vw, 20px);
    padding: 8px 0 4px;
}

.impact-item{
    display: grid;
    gap: 6px;
    justify-items: center;
    background: rgba(20,30,50,0.45);
    border: 1px solid rgba(64,132,255,0.18);
    border-radius: 14px;
    padding: 14px 10px;
}

.impact-number{
    font-weight: 800;
    font-size: clamp(20px, 3vw, 26px);
    line-height: 1;
    color: #3a78ff; /* blue accent */
    text-shadow: 0 0 18px rgba(58,120,255,0.45);
}

.impact-label{
    font-size: 12.5px;
    color: rgba(202,210,225,0.9);
    text-align: center;
}

.impact-footnote{
    margin-top: 14px;
    font-size: 13.5px;
    color: rgba(200,210,230,0.8);
}

/* Hero layout tweaks so the right card aligns like the old visual */
.hero .hero-content{
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(20px, 4vw, 48px);
    align-items: center;
}

/* Site-wide particle background */
.bg-particles {
    position: fixed;
    inset: 0;
    z-index: 0;           /* behind your content */
    pointer-events: none; /* don't block clicks */
  }
  
  /* Make sure sections don't hide it */
  body { background: #0b1424; } /* your base */
  .hero, .value-prop, .experience, .skills, .education, .contact, .footer {
    background: transparent;
    position: relative;
    z-index: 1;
  }

  /* Keep canvas behind everything */
.bg-particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
  }
  
  /* Brightening overlay above canvas, below content */
  .bg-lighten {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    /* simple version: lift overall luminance */
    background: rgba(255,255,255,0.08   );
    mix-blend-mode: screen;   /* brighten underlying pixels */
  }
  
  /* Ensure your page sections sit above */
  .hero, .value-prop, .experience, .skills, .education, .contact, .footer {
    position: relative;
    z-index: 2;
    background: transparent;
  }
  
  

/* Responsive: stack on mobile */
@media (max-width: 900px){
    .hero .hero-content{
        grid-template-columns: 1fr;
    }
    .impact-card{
        max-width: 100%;
    }
}

@keyframes softPulse {
    0% { text-shadow: 0 0 10px rgba(58,120,255,0.25); }
    50% { text-shadow: 0 0 20px rgba(58,120,255,0.45); }
    100% { text-shadow: 0 0 10px rgba(58,120,255,0.25); }
}

@media (prefers-reduced-motion: no-preference){
    .impact-number{
        animation: softPulse 3.5s ease-in-out infinite;
    }
}

/* Z-index + safe spacing (prevents overlap with scroll-to-top arrow) */
:root{
  --z-chat-panel: 2147483646;
  --z-chat-launcher: 2147483645;
  --safe-bottom: clamp(24px, 4vh, 40px);    /* bottom clearance */
  --panel-gap: clamp(130px, 16vh, 190px);   /* distance between launcher & panel */
}

/* Launcher — visible only when panel hidden */
.chat-launcher{
  position: fixed;
  right: 20px; /* Fixed right edge - extreme bottom-right corner */
  bottom: var(--safe-bottom);
  z-index: var(--z-chat-launcher);
  background:#0a33ea; color:#f1f5f9;
  border:none; border-radius:999px;
  padding:0.75rem 1rem; font-weight:600;
  box-shadow:0 10px 25px rgba(0,0,0,.25);
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.chat-launcher.is-hidden{ display:none !important; }
.chat-launcher:hover{ transform: translateY(-2px); }

/* Panel — sits ABOVE launcher by --panel-gap; three states below */
.chat-panel{
  position: fixed;
  right: 20px; /* Fixed right edge - ensures 40-50px clear space from content */
  bottom: 120px; /* Moved higher from bottom to create gap (was 80px) */
  width: 360px; /* Slightly narrower to reduce footprint */
  max-width: calc(100vw - 40px); /* Ensure 20px margins on each side */
  height: min(70vh, 680px);
  background: rgba(15, 23, 42, 0.5); /* More transparent (reduced from 0.65) */
  backdrop-filter: blur(14px); /* Stronger blur for better glass effect */
  -webkit-backdrop-filter: blur(14px); /* Safari support */
  color:#f1f5f9; 
  border:1px solid rgba(148, 163, 184, 0.25); /* More transparent border */
  border-radius:16px;
  display:flex; flex-direction:column; overflow:hidden;
  z-index: var(--z-chat-panel);
  isolation:isolate; /* header always on top within panel */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); /* Enhanced shadow for depth */
}
.chat-panel.is-hidden{ display:none !important; pointer-events:none; }
.chat-panel.is-collapsed{ height:auto; max-height:none; }
.chat-panel.is-collapsed .chat-body{ display:none !important; }

/* Header controls always clickable */
.chat-head{
  position:relative; z-index:1;
  display:flex; align-items:center; justify-content:space-between;
  padding:.6rem .8rem; 
  background: rgba(15, 23, 42, 0.65); /* More transparent header */
  border-bottom:1px solid rgba(148, 163, 184, 0.15);
  user-select:none;
}
.chat-title{
  font-size: 1.5rem; /* Smaller title (was default larger) */
  font-weight: 600;
  margin: 0;
  color: #f1f5f9;
}
.chat-head-actions{ display:flex; gap:.25rem; }
.chat-clear,.chat-min,.chat-close{
  background:transparent; color:#f1f5f9; border:none;
  font-size:1.1rem; line-height:1; cursor:pointer; padding:.25rem .5rem; border-radius:8px;
  transition: background 0.2s ease;
}
.chat-clear:hover,.chat-min:hover,.chat-close:hover{ background:#1e293b; }
.chat-clear{ font-size:0.9rem; }

/* Messages/Input - ensure visibility when panel is open */
.chat-body{ 
  display:flex !important; 
  flex-direction:column; 
  height:100%; 
}
.chat-panel.is-open .chat-body{ display:flex !important; }
.chat-panel.is-collapsed .chat-body{ display:none !important; }

.chat-messages{ flex:1; overflow:auto; padding:.9rem; background: transparent; }
.chat-message{ margin-bottom:.6rem; padding:.65rem .9rem; border-radius:16px; max-width:80%; white-space:pre-wrap; word-wrap:break-word; }
.chat-message.user{ margin-left:auto; background:#0a33ea; color:#f1f5f9; border-bottom-right-radius:4px; }
.chat-message.bot{ margin-right:auto; background:#1e293b; color:#f1f5f9; border-bottom-left-radius:4px; }
.chat-input-area{ 
  display:flex !important; 
  gap:.5rem; 
  align-items:flex-end; 
  padding:.6rem; 
  background: rgba(15, 23, 42, 0.65); /* More transparent input area */
  border-top:1px solid rgba(148, 163, 184, 0.15); 
  flex-shrink: 0; /* Prevent input from disappearing */
}
.chat-panel.is-open .chat-input-area{ display:flex !important; }
.chat-panel.is-collapsed .chat-input-area{ display:none !important; }
.chat-input{ 
  flex:1; 
  min-height:38px; 
  max-height:140px; 
  resize:vertical; 
  background:transparent; 
  color:#f1f5f9; 
  border:1px solid #94a3b8; 
  border-radius:10px; 
  padding:.5rem .6rem; 
  display:block !important; /* Ensure input is always visible when area is visible */
}
.chat-button{ background:#0a33ea; color:#f1f5f9; border:none; border-radius:10px; padding:.5rem .8rem; font-weight:600; cursor:pointer; }
.chat-button:hover{ background:#1d4ed8; }

/* Typing indicator */
.typing-indicator {
  display: inline-flex;
  gap: 4px;
  padding: 0.5rem 0;
}
.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: blink 1.2s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes blink { 
  0%, 80%, 100% { opacity: 0.3; } 
  40% { opacity: 1; } 
}

/* Mobile keeps relationship (panel above launcher) */
@media (max-width:640px){
  .chat-launcher{ 
    right: clamp(12px, 2vw, 20px); 
    bottom: var(--safe-bottom);
  }
  .chat-panel{ 
    right: 0; 
    left: 0; 
    width: 100%; 
    max-width: 100%;
    bottom: calc(var(--safe-bottom) + 60px); /* Adjust for mobile */
    height: calc(100dvh - (var(--safe-bottom) + 80px)); 
  }
}
