:root {
    --primary: #6200ee;
    --bg: #f5f5f5;
    --text: #333;
    --white: #fff;
    --nav-height: 80px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
}

/* Add padding for the bottom nav only on mobile screens */
@media (max-width: 767.98px) {
    body {
        /* Space for bottom nav */
        padding-bottom: calc(var(--nav-height) + 20px);
    }

    .chat-card {
        /* Mobile height: viewport - main's vertical padding - bottom nav height */
        height: calc(100vh - (1.5rem * 2) - var(--nav-height));
    }
}



/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* Ensure Offcanvas is above bottom nav */
.offcanvas {
    z-index: 1050 !important;
}

.nav-item {
    text-decoration: none;
    color: #888;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.nav-item.active {
    color: var(--primary);
    font-weight: bold;
}

/* Chat Styles */
.chat-window {
    /* Let the parent .chat-card control the height */
    flex-grow: 1;
    overflow-y: auto;
}

/* New class to make the chat card fill the vertical space */
.chat-card {
    display: flex;
    flex-direction: column;
    /* Desktop height: viewport - top nav height - main's vertical padding */
    height: calc(100vh - 70px - (3rem));
    /* 1.5rem top + 1.5rem bottom padding */
}

.message {
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.me {
    align-self: flex-end;
    background: var(--primary);
    color: white;
}

.message.other {
    align-self: flex-start;
    background: #e0e0e0;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Role Selector for Registration */
.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.role-selector input[type="radio"] {
    display: none;
    /* Hide the actual radio button */
}

.role-option {
    display: block;
    text-align: center;
    padding: 20px 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.role-selector input[type="radio"]:checked+.role-option {
    border-color: var(--primary);
    background-color: #f3e5f5;
    /* Light purple */
    box-shadow: 0 0 0 2px var(--primary);
}

/* --- Modern UI & Glassmorphism Utilities --- */

:root {
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* Vibrant mesh background for modern feel */
.bg-modern-mesh {
    background-color: #f5f5f5;
    background-image: 
        radial-gradient(at 0% 0%, rgba(98, 0, 238, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(3, 218, 198, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(98, 0, 238, 0.05) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(3, 218, 198, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.25);
}

/* Soft animated blobs in background */
.blob-area {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    top: 0;
    left: 0;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    animation: blobify 20s infinite alternate;
}

@keyframes blobify {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

.icon-circle-lg {
    width: 90px;
    height: 90px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 2.2rem;
    margin-bottom: 2rem;
    transition: all 0.5s ease;
}

.glass-card:hover .icon-circle-lg {
    transform: rotate(10deg) scale(1.1);
}

/* --- Modern Button Styles --- */
.btn {
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none; /* Materia uses uppercase, we want rounder feel */
    letter-spacing: 0.3px;
    border: none;
}

.btn-lg {
    padding: 0.8rem 2rem;
}

.btn-primary {
    background: linear-gradient(135deg, #6200ee 0%, #7c4dff 100%);
    box-shadow: 0 4px 15px rgba(98, 0, 238, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(98, 0, 238, 0.4);
    background: linear-gradient(135deg, #7c4dff 0%, #6200ee 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #03dac6 0%, #018786 100%);
    box-shadow: 0 4px 15px rgba(3, 218, 198, 0.2);
    color: #fff;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(3, 218, 198, 0.3);
    color: #fff;
}

.btn-outline-primary {
    border: 2px solid #6200ee;
    background: transparent;
    color: #6200ee;
}

.btn-outline-primary:hover {
    background: rgba(98, 0, 238, 0.05);
    transform: translateY(-2px);
}

/* Fix for icons in buttons */
.btn i {
    vertical-align: middle;
}

/* Helper to preserve line breaks from textareas */
.text-pre-wrap {
    white-space: pre-wrap;
}

/* Make share button feel more interactive */
.js-share-button {
    cursor: pointer;
}

/* --- Premium Bento Box UI (Native CSS Alternative to Tailwind) --- */
.text-gradient {
    background: linear-gradient(135deg, #6200ee 0%, #03dac6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bento-title {
    letter-spacing: -1px;
}

.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.bento-box {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem;
    border-radius: 2.5rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    min-height: 400px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.05);
}

.bento-box:hover {
    transform: translateY(-8px);
    color: inherit;
    background: rgba(255, 255, 255, 0.85);
}

.bento-provider:hover { box-shadow: 0 20px 50px -10px rgba(98, 0, 238, 0.15); }
.bento-seeker:hover { box-shadow: 0 20px 50px -10px rgba(3, 218, 198, 0.15); }

/* Soft Glowing Blobs in corners */
.bento-blob {
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    transition: transform 0.8s ease;
    z-index: 0;
}

.blob-primary {
    background: rgba(98, 0, 238, 0.15);
    top: -50px;
    right: -50px;
}

.blob-info {
    background: rgba(3, 218, 198, 0.15);
    bottom: -50px;
    left: -50px;
}

.bento-box:hover .bento-blob {
    transform: scale(1.5);
}

.bento-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bento-icon-wrapper {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1.25rem;
    font-size: 2rem;
    margin-bottom: 2rem;
    box-shadow: inset 0 2px 5px rgba(255,255,255,0.5);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-primary-soft { background: #ede9fe; color: #6200ee !important; }
.bg-info-soft { background: #e0f2f1; color: #00897b !important; }

.bento-box:hover .bento-icon-wrapper {
    transform: rotate(10deg) scale(1.1);
}

.bento-heading {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1e293b;
}

.bento-text {
    font-size: 1.1rem;
    color: #475569;
    line-height: 1.7;
}

.bento-cta {
    margin-top: auto;
    padding-top: 2rem;
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.bento-cta i {
    margin-left: 0.5rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bento-box:hover .bento-cta i {
    transform: translateX(8px);
}

/* Base utility for native premium feel */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease !important;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 1.5rem 3.5rem rgba(0, 0, 0, 0.1) !important;
}

.blur-bg {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.hover-danger { transition: color 0.2s; }
.hover-danger:hover { color: #dc3545 !important; }

.hover-primary { transition: color 0.2s; }
.hover-primary:hover { color: #6200ee !important; }