/* === CSS Variables === */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: #16161f;

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;

    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-glow: rgba(99, 102, 241, 0.4);

    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* === Typography === */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h3 { font-size: 1.25rem; }

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === Animations === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px var(--accent-glow), 0 0 60px var(--accent-glow); }
    50% { box-shadow: 0 0 40px var(--accent-glow), 0 0 80px var(--accent-glow); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.8s ease forwards;
}

.animate-slide-up-delay {
    opacity: 0;
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.animate-slide-up-delay-2 {
    opacity: 0;
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.4s;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* === Buttons === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--gradient-primary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm), 0 0 20px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 30px rgba(99, 102, 241, 0.4);
}

.btn-primary.btn-large {
    padding: 16px 32px;
    font-size: 1.05rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.03);
}

.btn-arrow {
    transition: transform var(--transition-fast);
}

.btn-primary:hover .btn-arrow {
    transform: translateX(4px);
}

/* === Navigation === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
}

.logo-icon {
    color: var(--accent-primary);
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

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

/* === Animations extras === */
@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-10deg); }
}

.wave {
    display: inline-block;
    animation: wave 1.5s ease-in-out infinite;
    transform-origin: 70% 70%;
}

.wink {
    display: inline-block;
    transition: transform var(--transition-fast);
}

.wink:hover {
    transform: scale(1.3);
}

/* === Landing Section === */
.landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 100px 40px 60px;
    position: relative;
    overflow: hidden;
}

.landing::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    gap: 60px;
}

.hero-content {
    flex: 1;
    max-width: 650px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--gradient-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--accent-primary);
    margin-bottom: 24px;
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulse 2s ease infinite;
}

.hero h1 {
    margin-bottom: 24px;
}

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

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-subtitle em {
    color: var(--accent-primary);
    font-style: normal;
    font-weight: 500;
}

.hero-subtitle-secondary {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.hero-subtitle-secondary strong {
    color: var(--text-primary);
}

/* Apps Panel */
.apps-panel {
    flex: 1;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.apps-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.apps-panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.apps-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.apps-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-base);
    cursor: pointer;
}

.app-card:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-glow);
}

.app-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.app-info {
    flex: 1;
    min-width: 0;
}

.app-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.app-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.app-arrow {
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.app-card:hover .app-arrow {
    color: var(--accent-primary);
    transform: translateX(4px);
}

.app-card-coming-soon {
    opacity: 0.5;
    cursor: default;
}

.app-card-coming-soon:hover {
    border-color: var(--border-color);
    transform: none;
    box-shadow: none;
}

.app-card-coming-soon .app-icon {
    background: var(--bg-secondary);
}

.app-card-more {
    border-style: dashed;
    cursor: default;
}

.app-card-more:hover {
    border-color: var(--border-hover);
    transform: none;
    box-shadow: none;
}

.app-card-more .app-icon {
    background: transparent;
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
}

/* === Features Section === */
.features {
    padding: 100px 40px;
    background: var(--bg-secondary);
}

.features-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
}

.features-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 16px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.feature-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* === Chat Section === */
.chat-section {
    padding: 80px 40px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.chat-container {
    width: 100%;
    max-width: 800px;
    height: 600px;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease infinite;
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.chat-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-action-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    gap: 12px;
    animation: slideUp 0.3s ease;
}

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

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

.message.assistant .message-avatar {
    background: var(--gradient-primary);
}

.message.user .message-avatar {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.message-content {
    max-width: 70%;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    line-height: 1.6;
}

.message.assistant .message-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

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

.message-content ul {
    margin: 12px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 6px 0;
    color: var(--text-secondary);
}

.message.user .message-content li {
    color: rgba(255, 255, 255, 0.9);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 14px 18px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* Chat Input */
.chat-input-container {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    transition: border-color var(--transition-fast);
}

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

#chatInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 120px;
}

#chatInput::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.send-icon {
    font-size: 1.1rem;
}

.chat-footer {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.separator {
    color: var(--border-color);
}

/* === Footer === */
.footer {
    padding: 40px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        gap: 50px;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-subtitle {
        max-width: 100%;
    }

    .hero-cta {
        justify-content: center;
    }

    .apps-panel {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 16px 20px;
    }

    .nav-links a:not(.btn-primary) {
        display: none;
    }

    .landing {
        padding: 80px 20px 40px;
    }

    .features,
    .chat-section {
        padding: 60px 20px;
    }

    .chat-container {
        height: 500px;
    }

    .message-content {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    .apps-panel {
        padding: 16px;
    }

    .app-card {
        padding: 12px;
    }
}
