* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 30%, #16213e 70%, #0f172a 100%);
    color: white;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background geometric shapes - matching previous design */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.bg-shapes::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 800px 400px at 0% 50%, rgba(124, 58, 237, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 600px 300px at 100% 30%, rgba(59, 130, 246, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 400px 600px at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 60%);
}

/* Curved line patterns */
.bg-shapes::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(45deg,
            transparent,
            transparent 2px,
            rgba(124, 58, 237, 0.03) 2px,
            rgba(124, 58, 237, 0.03) 4px),
        repeating-linear-gradient(-45deg,
            transparent,
            transparent 2px,
            rgba(59, 130, 246, 0.03) 2px,
            rgba(59, 130, 246, 0.03) 4px);
}

.shape {
    position: absolute;
    opacity: 0.08;
    border-radius: 50%;
    filter: blur(1px);
}

.shape-1 {
    width: 800px;
    height: 800px;
    background: conic-gradient(from 0deg, rgba(124, 58, 237, 0.2), rgba(59, 130, 246, 0.2), rgba(124, 58, 237, 0.2));
    top: -300px;
    left: -400px;
    animation: rotate 25s linear infinite;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: conic-gradient(from 180deg, rgba(236, 72, 153, 0.2), rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    bottom: -200px;
    right: -250px;
    animation: rotate 20s linear infinite reverse;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #7c3aed, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-section {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.btn-section li {
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: color 0.3s ease;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-section li:hover {
    color: inherit;
}

.btn-start {
    background: inherit;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    border: 1.5px solid #7286FF;
    border-radius: 25px;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.3);
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 5;
}

.hero {
    text-align: center;
    padding: 4rem 0 2rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text {
    background: linear-gradient(45deg, #7c3aed, #3b82f6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto 3rem;
    line-height: 1.6;
}

.input-section {
    max-width: 600px;
    margin: 0 auto 3rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.url-input {
    flex: 1;
    min-width: 300px;
    padding: 1rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.url-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

.url-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.analyze-btn {
    background: inherit;
    border-radius: 25px;
    border: 1.5px solid #7c3aed;
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(124, 58, 237, 0.4);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 4rem 0;
}

.feature-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #e2e8f0;
}

.feature-card p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

/* Responsive design */
@media (max-width: 768px) {
    .btn-section {
        display: none;
    }

    .input-section {
        flex-direction: column;
    }

    .url-input {
        min-width: auto;
    }

    .hero {
        padding: 2rem 0;
    }

    .features {
        grid-template-columns: 1fr;
    }
}


/* * Chat Container - Main wrapper for all chat modes */
.chat-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1000;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chat modes */
.chat-container.hidden {
    opacity: 0;
    visibility: hidden;
}

.chat-container.embedded {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.chat-container.fullscreen {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
}

/* Chat Panel - The actual chat interface */
.chat-panel {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Embedded mode positioning */
.chat-container.embedded .chat-panel {
    position: absolute;
    right: 2rem;
    bottom: 2rem;
    width: 400px;
    height: 500px;
    max-height: 70vh;
    z-index: 1001;
}

/* Full-screen mode positioning */
.chat-container.fullscreen .chat-panel {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    height: 80vh;
    border-radius: 25px;
}

/* Chat Header */
.chat-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 20px 20px 0 0;
}

.chat-container.fullscreen .chat-header {
    border-radius: 25px 25px 0 0;
}

.chat-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-title::before {
    content: '🤖';
    font-size: 1.5rem;
}

.chat-controls {
    display: flex;
    gap: 0.5rem;
}

.chat-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.chat-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: scale(1.05);
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.5);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.7);
}

/* Individual Message Bubbles */
.message {
    max-width: 85%;
    padding: 1rem 1.5rem;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    color: white;
    border-bottom-right-radius: 8px;
}

.message.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    border-bottom-left-radius: 8px;
}

.message.ai code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
}

/* Typing Indicator */
.typing-indicator {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px 18px 18px 8px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.typing-dots {
    display: flex;
    gap: 0.3rem;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.7);
    animation: typingPulse 1.5s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Chat Input Area */
.chat-input-area {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 20px 20px;
}

.chat-container.fullscreen .chat-input-area {
    border-radius: 0 0 25px 25px;
}

.chat-input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    line-height: 1.4;
    resize: none;
    min-height: 20px;
    max-height: 120px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    background: rgba(255, 255, 255, 0.15);
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-send-btn {
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    height: 48px;
    width: 48px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send-btn::before {
    content: '→';
    transform: rotate(-45deg);
}

/* Chat Toggle Button - Shows when chat is hidden */
.chat-toggle-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    height: 60px;
    width: 60px;
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    animation: chatPulse 2s infinite;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(124, 58, 237, 0.6);
}

.chat-toggle-btn::before {
    content: '💬';
}

@keyframes chatPulse {

    0%,
    100% {
        box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4);
    }

    50% {
        box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4), 0 0 0 10px rgba(124, 58, 237, 0.1);
    }
}

/* Hide chat toggle when chat is visible */
.chat-container.embedded+.chat-toggle-btn,
.chat-container.fullscreen+.chat-toggle-btn {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Quick Actions - Suggested questions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.quick-action-btn {
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.quick-action-btn:hover {
    background: rgba(124, 58, 237, 0.3);
    border-color: rgba(124, 58, 237, 0.5);
    transform: translateY(-1px);
}

/* AI Summary Section - Shows in results */
.ai-summary-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.ai-summary-section h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-summary-section h3::before {
    content: '🤖';
    font-size: 1.2rem;
}

.ai-summary-content {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.ai-summary-loading {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.ai-summary-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(124, 58, 237, 0.3);
    border-top: 2px solid #7c3aed;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.start-chat-btn {
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.start-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.3);
}

.start-chat-btn::after {
    content: '💬';
    font-size: 1.1rem;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .btn-section {
        display: none;
    }

    /* Mobile Chat Adjustments */
    .chat-container.embedded .chat-panel {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
        width: auto;
        height: 60vh;
        max-height: none;
    }

    .chat-container.fullscreen .chat-panel {
        width: 95%;
        height: 90vh;
        top: 5vh;
        transform: translateX(-50%);
        left: 50%;
    }

    .chat-toggle-btn {
        bottom: 1rem;
        right: 1rem;
        height: 50px;
        width: 50px;
        font-size: 1.3rem;
    }

    .chat-input-wrapper {
        gap: 0.5rem;
    }

    .chat-send-btn {
        height: 40px;
        width: 40px;
        font-size: 1rem;
    }

    .quick-actions {
        flex-direction: column;
    }

    .quick-action-btn {
        width: 100%;
        text-align: center;
    }

    .message {
        max-width: 95%;
    }

    /* Hide some chat controls on mobile */
    .chat-control-btn:not(.close-btn) {
        display: none;
    }
}

@media (max-width: 480px) {
    .chat-header {
        padding: 1rem;
    }

    .chat-messages {
        padding: 1rem;
    }

    .chat-input-area {
        padding: 1rem;
    }

    .chat-title {
        font-size: 1rem;
    }
}