@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --primary-color: #6366f1;
    /* Indigo */
    --primary-hover: #4f46e5;
    --secondary-color: #10b981;
    /* Emerald */
    --border-color: #e2e8f0;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --footer-bg: #0f172a;
    --footer-text: #f8fafc;
    --font-family: 'Plus Jakarta Sans', sans-serif;

    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.02);
    --shadow-premium: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
    --radius-lg: 24px;
    --radius-md: 16px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
    --bg-color: #020617;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --card-bg: #0f172a;
    --primary-color: #818cf8;
    --primary-hover: #a5b4fc;
    --border-color: #1e293b;
    --nav-bg: rgba(15, 23, 42, 0.9);
    --footer-bg: #020617;
    --footer-text: #f1f5f9;
}

/* Chatbot UI */
.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 3000;
}

.chat-button {
    width: 64px;
    height: 64px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    transition: var(--transition);
}

.chat-button:hover {
    transform: scale(1.1) rotate(10deg);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 450px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-header {
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    padding: 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message {
    max-width: 90%;
    padding: 0.5rem 0.7rem;
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.message.user {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 2px;
}

.message.bot {
    align-self: flex-start;
    background: var(--bg-color);
    color: var(--text-color);
    border-bottom-left-radius: 2px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.chat-input-area {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.4rem;
}

.chat-input {
    flex: 1;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.8rem;
    font-family: inherit;
}

@media (max-width: 640px) {
    .chat-window {
        width: calc(100vw - 4rem);
        height: 35vh;
        bottom: 70px;
        right: 0;
    }
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

/* Navbar - Glassmorphism */
.navbar {
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.brand-text {
    background: linear-gradient(135deg, var(--primary-color), #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.brand-mark {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    display: block;
    margin-top: 1px;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0.8;
}

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

.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-subtle);
}

/* Bento Grid System */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 1.5rem;
    margin: 2rem 0;
}

.bento-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-subtle);
}

.bento-item:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-premium);
    border-color: var(--primary-color);
}

/* Bento Item Variants */
.col-span-2 {
    grid-column: span 2;
}

.col-span-3 {
    grid-column: span 3;
}

.col-span-4 {
    grid-column: span 4;
}

.row-span-2 {
    grid-row: span 2;
}

/* Content Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 1rem;
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.4);
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-subtle);
}

.btn-secondary:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-premium);
}

/* Forms */
.form-control {
    width: 100%;
    padding: 1.25rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-color);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--card-bg);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Calculator Result UI */
.result-box {
    margin-top: 2rem;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid var(--border-color);
    text-align: center;
    animation: reveal 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Blog Styling */
.blog-card-meta {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    letter-spacing: 1px;
}

.blog-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.blog-content p,
.blog-content h2,
.blog-content h3,
.blog-content ul,
.blog-content ol {
    margin-bottom: 1.5rem;
}

.blog-content h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 3rem;
}

.blog-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
}

.blog-content ul,
.blog-content ol {
    padding-left: 2rem;
}

.blog-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    font-style: italic;
    color: var(--text-muted);
    margin: 2rem 0;
}

/* Footer */
.footer {
    position: relative;
    overflow: hidden;
    background: var(--footer-bg);
    color: var(--footer-text);
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    padding: 4rem 2rem 2.5rem;
    margin-top: 6rem;
    text-align: center;
}

.footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(99, 102, 241, 0.24) 0%, rgba(99, 102, 241, 0) 45%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(2, 6, 23, 1) 100%);
    pointer-events: none;
}

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

.footer-links {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.footer-links a {
    color: rgba(248, 250, 252, 0.88);
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #ffffff;
    border-color: rgba(99, 102, 241, 0.65);
    background: rgba(99, 102, 241, 0.28);
    transform: translateY(-2px);
}

.footer p {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    color: rgba(248, 250, 252, 0.86);
    line-height: 1.7;
    font-size: 0.95rem;
}

.footer small {
    color: rgba(148, 163, 184, 0.95);
    display: inline-block;
    margin-top: 0.35rem;
}

/* Cookie Banner - Bento Style */
.cookie-banner {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    max-width: 400px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
}

/* Responsive */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .col-span-2,
    .col-span-3,
    .col-span-4 {
        grid-column: span 1;
    }

    .navbar {
        padding: 1rem;
    }

    .brand-mark {
        width: 26px;
        height: 26px;
    }

    .nav-links {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer {
        padding: 3rem 1rem 2rem;
    }

    .footer-links {
        gap: 0.65rem;
    }

    .footer-links a {
        width: 100%;
        max-width: 280px;
    }
}
