:root {
    --bg-color: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.3);
    --secondary: #3b82f6;
    --accent: #d946ef;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Generic Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px var(--primary-glow), 0 5px 15px rgba(139, 92, 246, 0.3);
    background: #7c3aed;
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* Generic Layout / Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Generic Cards */
.feature-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(16px);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.15);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.feature-card p {
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* AI Chat UI - Modern Glassmorphism */
.ai-chat-hint {
    position: fixed;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--glass-bg);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    cursor: pointer;
    animation: float-hint 2s ease-in-out infinite;
    display: none;
}

@keyframes float-hint {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.ai-chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50%;
    height: 60vh;
    max-width: calc(100vw - 40px);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.15);
    display: none;
    flex-direction: column;
    z-index: 1001;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    pointer-events: none;
    animation: chat-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes chat-pop {
    from {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@media screen and (max-width: 768px) {
    .ai-chat-container {
        width: 100%;
        bottom: 0;
        right: 0;
        height: 100dvh;
        max-width: 100vw;
        border-radius: 0;
    }
}

.ai-chat-container.mobile-fullscreen {
    width: 100%;
    bottom: 0;
    right: 0;
    height: 100dvh;
    max-width: 100vw;
    border-radius: 0;
}

.ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    pointer-events: auto;
}

.ai-chat-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chat-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.ai-chat-close:hover {
    color: var(--accent);
}

.ai-chat-messages {
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 20px;
    pointer-events: auto;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 10px;
}

.ai-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: fade-in-up 0.3s ease;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.ai-message.npc {
    align-self: flex-start;
}

.ai-message.user {
    align-self: flex-end;
    align-items: flex-end;
}

.ai-message-bubble {
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-break: break-word;
}

.ai-message.npc .ai-message-bubble {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.ai-message.user .ai-message-bubble {
    background: var(--primary);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.ai-message-subtext {
    font-size: 0.85rem;
    margin-top: 6px;
    opacity: 0.9;
}

.ai-message.npc .ai-message-subtext {
    color: var(--text-muted);
}

.ai-message.user .ai-message-subtext {
    color: #ff6b6b;
    font-weight: 500;
}

.ai-chat-input-area {
    padding: 20px 30px;
    display: flex;
    gap: 15px;
    align-items: center;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
    pointer-events: auto;
}

.ai-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 12px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s ease;
}

.ai-chat-input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.ai-chat-send {
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px var(--primary-glow);
    font-size: 1.2rem;
}

.ai-chat-send:hover {
    transform: translateY(-2px);
    background: #7c3aed;
    box-shadow: 0 6px 15px var(--primary-glow);
}

.ai-chat-translate-btn {
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 5px;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

.ai-chat-translate-btn:hover {
    text-decoration: underline;
}

.ai-continue-indicator {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    margin-top: 5px;
    animation: typing-bounce 1s infinite alternate;
    display: none;
    align-self: flex-start;
    margin-left: 10px;
}