@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-bg: #1a202c;
    --secondary-bg: #2d3748;
    --sidebar-bg: #232a3b;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --text-color: #e4e4e7;
    --text-secondary: #a1a1aa;
    --border-color: #4a5568;
    --accent-glow: rgba(99, 102, 241, 0.3);
}

html {
    scroll-behavior: smooth;
}

* {
    transition: all 0.3s ease-in-out;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background-color: var(--primary-bg);
    color: var(--text-color);
    overflow-x: hidden;
}

.gradient-text {
    background: linear-gradient(90deg, #a855f7, #d946ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    animation: gradient-animation 5s ease infinite;
    background-size: 200% 200%;
}
.accent-text {
    color: var(--accent-color);
}


@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


@keyframes slideInDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}



.home-main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

section {
    width: 100%;
    max-width: 1200px;
    padding: 60px 20px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUP 1s forwards;
    animation-delay: 0.5s;
}

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

.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 60px;
    width: 100%;
    max-width: 1400px;
    padding: 0 50px 20px;
}

.hero-content {
    text-align: left;
}

.hero h1 {
    font-size: 4.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero h1 .gradient-text {
    display: inline-flex;
    align-items: center;
    gap: 20px;
}

.hero h1 .gradient-text i {
    font-size: 3.5rem;
}

.hero .subtitle {
    font-size: 1.2rem;
    max-width: 500px;
    margin-bottom: 40px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.cta-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hero-content .btn-large {
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--accent-color);
    border: none;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.hero .btn-large:hover {
    transform: translateY(-3px);
    background-color: var(--accent-hover);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.no-cc-required {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.no-cc-required i {
    margin-right: 8px;
}

section h2 {
    font-size: 3rem;
    margin-bottom: 50px;
}

.features {
    background-color: var(--secondary-bg);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-item {
    background: var(--sidebar-bg);
    padding: 30px;
    border-radius: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}

.feature-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.feature-item h3 {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.why-supchat ul {
    list-style: none;
    padding: 0;
    display: inline-block;
    text-align: left;
}

.why-supchat li {
    font-size: 1.2rem;
    margin-bottom: 15px;
    background: var(--secondary-bg);
    padding: 15px 25px;
    border-radius: 8px;
    transition: background-color 0.3s;
    border-left: 4px solid var(--accent-color);
}

.why-supchat li:hover {
    background: var(--sidebar-bg);
}

.for-who {
    background-color: var(--secondary-bg);
}

.for-who p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.hero-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    margin-top: 2rem;
}

#sources-animation {
    width: 450px;
    height: auto;
    background: linear-gradient(135deg, #2d3748, #1a202c);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    position: relative;
    transform: rotateY(-15deg) rotateX(10deg);
    transition: transform 0.5s ease;
}

#sources-animation:hover {
    transform: rotateY(0) rotateX(0);
}

.sources-header {
    margin-bottom: 20px;
    text-align: left;
}

.sources-header h4 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
}

.source-item {
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

.source-item:hover {
    background-color: var(--sidebar-bg);
    border-color: var(--accent-color);
}

.source-item i {
    font-size: 1.5rem;
    margin-right: 15px;
}

.pdf-source {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.pdf-source.visible {
    opacity: 1;
    transform: translateY(0);
}

.pdf-source i {
    color: #ef4444;
}

.add-source {
    border-style: dashed;
}

.add-source i {
    color: var(--accent-color);
}

#sources-animation .cursor-icon {
    position: absolute;
    font-size: 2rem;
    color: var(--text-color);
    transform: rotate(-25deg);
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    animation: cursor-move 8s infinite ease-in-out;
}

#sources-animation .dragged-pdf-icon {
    position: absolute;
    font-size: 2.5rem;
    color: #ef4444;
    z-index: 9;
    pointer-events: none;
    opacity: 0;
    animation: pdf-drag-animation 8s infinite ease-in-out;
}

.add-source {
    position: relative;
    overflow: hidden;
}

.drop-zone-content {
    transition: opacity 0.3s ease;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.success-tick {
    font-size: 3rem;
    color: #28a745; /* A vibrant green for the success tick */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: tick-pop 0.5s forwards;
}

@keyframes tick-pop {
    0% { transform: translate(-50%, -50%) scale(0); }
    70% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes cursor-move {
    0% { opacity: 0; top: 100px; left: 20px; }
    10% { opacity: 1; top: 100px; left: 20px; }
    /* Centered position: top ~115px, left ~225px */
    25% { top: 115px; left: 225px; }
    35% { top: 115px; left: 225px; }
    45% { opacity: 0; }
    100% { opacity: 0; }
}

@keyframes pdf-drag-animation {
    0% { opacity: 0; top: 85px; left: 20px; transform: scale(1); }
    10% { opacity: 1; top: 85px; left: 20px; transform: scale(1); }
    /* Centered position: top ~100px, left ~200px to align with cursor tip */
    25% { top: 100px; left: 200px; transform: scale(1.1); }
    35% { opacity: 0; top: 100px; left: 200px; transform: scale(1.1); }
    100% { opacity: 0; }
}

.chat-preview-section {
    background-color: var(--secondary-bg);
    padding: 80px 20px;
}

.chat-preview-section h2 {
    margin-bottom: 40px;
}

.animation-container {
    width: 100%;
    max-width: 600px;
    /* height: 400px; */ /* Removed fixed height to allow stretching */
    background: var(--primary-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}

#chat-example-animation {
    justify-content: flex-start;
    padding: 0;
    gap: 10px;
    flex: 1; /* Added flex-grow */
    flex-direction: column;
    display: flex;
}

.chat-bubble-example {
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 80%;
    opacity: 0;
    transform: translateY(20px);
    animation: popIn 0.5s forwards;
    line-height: 1.5;
}

.chat-bubble-example.user {
    background-color: var(--accent-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.chat-bubble-example.bot {
    background-color: var(--sidebar-bg);
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

/* Targeting children directly for correct animation order */
#chat-example-animation > .chat-bubble-example:nth-child(2) { animation-delay: 0.5s; }
#chat-example-animation > .chat-bubble-example:nth-child(3) { animation-delay: 1.5s; }
#chat-example-animation > .chat-bubble-example:nth-child(4) { animation-delay: 2.5s; }
#chat-example-animation > .chat-bubble-example:nth-child(5) { animation-delay: 3.5s; }


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

.typing-example {
    display: flex;
    align-items: center;
    padding: 15px;
    align-self: flex-start;
}

.typing-example span {
    height: 8px;
    width: 8px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-example span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-example span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1.0);
    }
}

.how-it-works-container {
    display: flex; /* Changed to flexbox */
    gap: 40px;
    align-items: stretch;
    max-width: 1200px;
    margin: 0 auto;
}

.how-it-works-explanation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: var(--primary-bg);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    flex: 1; /* Added flex-grow */
}

.explanation-item {
    text-align: center;
    max-width: 200px;
}

.explanation-item i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    display: block;
}

.explanation-item h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.explanation-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.arrow-connector i {
    font-size: 2.5rem;
    color: var(--text-secondary);
    margin: 10px 0; /* Add some margin */
}

@media (max-width: 992px) {
    .how-it-works-container {
        grid-template-columns: 1fr;
    }
    .how-it-works-explanation {
        order: 1;
    }
    #chat-example-animation {
        order: 2;
    }
}

@media (max-width: 576px) {
    .how-it-works-explanation {
        flex-direction: column;
    }
    .arrow-connector i {
        transform: rotate(90deg);
        margin: 20px 0;
    }
}

/* Icon Styles */
section h2 i {
    margin-right: 15px;
    color: var(--accent-color);
}

.why-supchat li i {
    color: var(--accent-color);
    margin-right: 10px;
}

.chat-header {
    background: var(--secondary-bg);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    text-align: center;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.chat-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

#chat-example-animation .chat-bubble-example {
    margin: 0 20px; /* Add horizontal margin */
}