/* Base Styles & CSS Variables */
:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-chat: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --gradient-glow: linear-gradient(135deg, rgba(59, 130, 246, 0.5), rgba(139, 92, 246, 0.5));
    --border-color: #334155;
    
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Hero Section */
.hero {
    position: relative;
    text-align: center;
    padding: 3rem 1rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.highlight {
    background: linear-gradient(135deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.hero-bg-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(59,130,246,0.1) 0%, rgba(15,23,42,0) 50%);
    z-index: 1;
    pointer-events: none;
}

/* Chat Section */
.chat-section {
    display: flex;
    flex-direction: column;
}

.chat-container {
    background: var(--bg-chat);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.chat-history {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

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

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

.message {
    display: flex;
    width: 100%;
    animation: fadeIn 0.3s ease forwards;
}

.message-content {
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-md);
    max-width: 85%;
    word-wrap: break-word;
    font-size: 0.95rem;
}

.bot-message {
    justify-content: flex-start;
}

.bot-message .message-content {
    background: #334155;
    border-bottom-left-radius: 2px;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-bottom-right-radius: 2px;
    color: white;
}

/* Quick Questions */
.quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quick-btn {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.quick-btn:hover, .quick-btn:focus {
    background: var(--accent-primary);
    color: white;
    outline: none;
    transform: translateY(-2px);
}

/* Chat Input Form */
.chat-input-area {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

#chat-input {
    flex: 1;
    background: #0f172a;
    border: 1px solid var(--border-color);
    padding: 1rem 1.2rem;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

#chat-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.send-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

/* Loading State */
.loading-state {
    display: flex;
    justify-content: flex-start;
    padding: 0.5rem;
}

.dots {
    display: flex;
    gap: 4px;
    background: #334155;
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-md);
    border-bottom-left-radius: 2px;
}

.dots span {
    width: 6px;
    height: 6px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dots span:nth-child(1) { animation-delay: -0.32s; }
.dots span:nth-child(2) { animation-delay: -0.16s; }

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

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

/* Dashboard Section */
.dashboard-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.2rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.info-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-secondary);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.card-meta {
    font-size: 0.75rem;
    margin-top: 0.8rem;
    display: flex;
    justify-content: space-between;
    color: #cbd5e1;
}

.tag {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .hero h1 { font-size: 2rem; }
    .chat-container { padding: 1rem; }
}
