/* Budeno Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Sora:wght@700;800&display=swap');

:root {
    --primary: #10B981;
    --primary-dark: #059669;
    --primary-light: #D1FAE5;
    --bg-white: #FFFFFF;
    --bg-gray: #F9FAFB;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --white: #FFFFFF;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 16px;
}

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

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

h1, h2, h3, .font-sora {
    font-family: 'Sora', sans-serif;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* --- Dashboard Layout --- */
header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-dot {
    width: 10px;
    height: 10px;
    background-color: var(--primary);
    border-radius: 50%;
}

/* --- Cards & Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-title {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.card-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    font-weight: 600;
}

.trend.up { color: #10B981; }
.trend.down { color: #EF4444; }

/* --- Analytics Section --- */
.analytics-section {
    margin-top: 48px;
}

.prediction-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border: none;
}

.prediction-card .card-title {
    color: rgba(255, 255, 255, 0.8);
}

.prediction-card .card-value {
    color: var(--white);
}

/* --- Advice Section --- */
.advice-box {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.advice-icon {
    font-size: 1.5rem;
    background: var(--white);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.advice-content h4 {
    margin-bottom: 4px;
    color: var(--primary-dark);
}

.advice-content p {
    font-size: 0.9375rem;
    color: var(--text-main);
}

/* --- Quick Entry --- */
.quick-entry-card {
    background: #FFFFFF;
    border: 2px solid var(--primary-light);
}

.quick-entry-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.quick-entry-form input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1rem;
    outline: none;
    background: var(--bg-gray);
    transition: border-color 0.2s;
}

.quick-entry-form input:focus {
    border-color: var(--primary);
    background: #fff;
}

.category-selector {
    position: relative;
}

.category-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-gray);
    font-size: 1.5rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.category-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.category-menu.active {
    display: grid;
}

.category-menu span {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 8px;
}

.category-menu span:hover {
    background: var(--primary-light);
}

.submit-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.2s;
}

.submit-btn:hover {
    background: var(--primary-dark);
}

/* --- Transactions --- */
.transaction-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.transaction-row:hover {
    background: var(--bg-gray);
}

.tx-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
}

.tx-info {
    flex: 1;
}

.tx-info h4 {
    font-size: 0.9375rem;
    font-weight: 600;
}

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

.tx-amount {
    font-weight: 700;
    color: #EF4444;
}

/* --- Floating Chatbot --- */
#chatbot-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-trigger-pill {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 12px 24px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: pulse-border 2s infinite;
}

.bot-icon-spark {
    font-size: 1.25rem;
    background: rgba(255, 255, 255, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}

.trigger-text {
    font-size: 0.9375rem;
    font-weight: 500;
}

.trigger-text strong {
    font-weight: 800;
    letter-spacing: 0.02em;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

#chatbot-trigger:hover {
    transform: scale(1.05) translateY(-4px);
}

#chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 350px;
    height: 500px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    border: 1px solid var(--border);
}

#chatbot-window.active {
    display: flex;
}

.chat-header {
    background: #075E54;
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: #E5DDD5; /* WhatsApp background color */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.9375rem;
    position: relative;
}

.msg-ai {
    align-self: flex-start;
    background: white;
    color: black;
    border-top-left-radius: 2px;
}

.msg-user {
    align-self: flex-end;
    background: #DCF8C6;
    color: black;
    border-top-right-radius: 2px;
}

.chat-input-area {
    padding: 12px;
    background: #F0F0F0;
    display: flex;
    gap: 8px;
}

.chat-input-area input {
    flex: 1;
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    outline: none;
}

.chat-send {
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .card-value {
        font-size: 1.75rem;
    }

    .quick-entry-form {
        flex-wrap: wrap;
    }

    .quick-entry-form input {
        width: 100%;
        order: 1;
    }

    .category-selector {
        order: 2;
        flex: 1;
    }

    .category-btn {
        width: 100%;
    }

    .submit-btn {
        order: 3;
        flex: 1;
    }

    .advice-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.25rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    #chatbot-window {
        width: calc(100% - 32px);
        right: 16px;
        left: 16px;
        bottom: 80px;
        height: 60vh;
    }

    .chatbot-trigger-pill {
        padding: 10px 16px;
    }

    .trigger-text {
        font-size: 0.8125rem;
    }
}

/* Tablet and Laptop optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
