/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #374151;
    --primary-hover: #1f2937;
    --secondary-color: #6b7280;
    --background-color: #e5e7eb;
    --surface-color: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --gradient-start: #6b7280;
    --gradient-end: #374151;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --dark-surface: #1f2937;
    --light-grey: #f3f4f6;
    --medium-grey: #9ca3af;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    /* Performance optimizations */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}


/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-brand i {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--light-grey);
    color: var(--text-primary);
}

.cta-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 0.875rem;
}

.cta-button:hover {
    background: var(--primary-hover);
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    margin-top: 70px;
    padding: 3rem 0;
    min-height: 75vh;
    display: flex;
    align-items: center;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn-primary, .btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-radius: 0.75rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
}

.btn-secondary:hover {
    background: var(--light-grey);
    transform: translateY(-2px);
}

/* Chat Preview */
.chat-preview {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.chat-header {
    background: var(--background-color);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.chat-dots {
    display: flex;
    gap: 0.5rem;
}

.chat-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.chat-dots span:nth-child(1) { background: var(--error-color); }
.chat-dots span:nth-child(2) { background: var(--warning-color); }
.chat-dots span:nth-child(3) { background: var(--success-color); }

.chat-body {
    padding: 1.5rem;
}

.preview-message {
    margin-bottom: 1rem;
}

.preview-message.user .message-bubble {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
    max-width: 70%;
}

.preview-message.bot .message-bubble {
    background: var(--light-grey);
    color: var(--text-primary);
    max-width: 70%;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
}

/* Features Section */
.features {
    padding: 5rem 0;
    background: rgba(243, 244, 246, 0.5);
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Chat Section */
.chat-section {
    padding: 5rem 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.chat-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--surface-color);
    border-radius: 1rem 1rem 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-header-main h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--light-grey);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* Improve scrolling performance */
    -webkit-overflow-scrolling: touch;
}

.message {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.bot-avatar {
    background: var(--primary-color);
    color: white;
}

.user-avatar {
    background: var(--secondary-color);
    color: white;
}

.message-content {
    flex: 1;
    background: var(--surface-color);
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-content {
    background: var(--primary-color);
    color: white;
}

.message-content p {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.input-container {
    padding: 1.5rem;
    background: var(--surface-color);
    border-radius: 0 0 1rem 1rem;
    border: 1px solid var(--border-color);
    border-top: none;
}

.input-wrapper {
    position: relative;
    background: var(--surface-color);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    padding: 1rem 3rem 1rem 1rem;
    transition: border-color 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
}

#messageInput {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
    max-height: 120px;
}

#messageInput::placeholder {
    color: var(--text-secondary);
}

#imagePromptInput {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
    max-height: 120px;
}

#imagePromptInput::placeholder {
    color: var(--text-secondary);
}

#claudeInput {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
    max-height: 120px;
}

#claudeInput::placeholder {
    color: var(--text-secondary);
}

#sendButton {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 1rem;
}

#sendButton:hover {
    background: var(--primary-hover);
    transform: translateY(-50%) scale(1.05);
}

#sendButton:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    transform: translateY(-50%) scale(1);
}

#generateButton {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 1rem;
}

#generateButton:hover {
    background: var(--primary-hover);
    transform: translateY(-50%) scale(1.05);
}

#generateButton:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    transform: translateY(-50%) scale(1);
}

#claudeButton {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 1rem;
}

#claudeButton:hover {
    background: var(--primary-hover);
    transform: translateY(-50%) scale(1.05);
}

#claudeButton:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    transform: translateY(-50%) scale(1);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    border-top: 1px solid #333333;
    padding: 3rem 0 1rem;
    color: #e5e7eb;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-main {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-brand-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
}

.footer-brand i {
    color: #6b7280;
    font-size: 1.5rem;
}

.footer-description {
    color: #9ca3af;
    line-height: 1.6;
    max-width: 300px;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateY(-2px);
}

.footer-links-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-title {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-link:hover {
    color: #ffffff;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid #444444;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    color: #9ca3af;
    font-size: 0.9rem;
}

.footer-bottom-links {
    display: flex;
    gap: 2rem;
}

.footer-bottom-link {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-bottom-link:hover {
    color: #ffffff;
}

/* Legacy footer styles for backward compatibility */
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .nav-hamburger {
        display: flex;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-main {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-links-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-bottom-links {
        gap: 1rem;
    }
    
    /* Legacy footer styles for backward compatibility */
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nav-container,
    .hero-container,
    .features-container,
    .footer-container {
        padding: 0 1rem;
    }
    
    .chat-container {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .footer-links-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .footer-social {
        justify-content: center;
    }
}