/**
 * Genius - Estilos Principais
 * Réplica fiel do layout React/Tailwind original
 */

/* ==========================================
   Container
   ========================================== */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
        max-width: 1280px;
    }
}

/* ==========================================
   Buttons (shadcn/ui style)
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    outline: none;
}

.btn:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

/* Button sizes */
.btn-sm {
    height: 2.25rem;
    padding: 0 0.75rem;
    font-size: 0.75rem;
}

.btn {
    height: 2.5rem;
    padding: 0 1rem;
}

.btn-lg {
    height: 2.75rem;
    padding: 0 1.5rem;
    font-size: 1rem;
}

.btn-xl {
    height: 3rem;
    padding: 0 2rem;
    font-size: 1.125rem;
}

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
}

/* Button variants */
.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 10px 25px var(--primary-shadow);
}

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

.btn-secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
}

.btn-secondary:hover {
    background-color: var(--muted);
}

.btn-outline {
    border: 1px solid var(--border);
    background-color: transparent;
    color: var(--foreground);
}

.btn-outline:hover {
    background-color: var(--secondary);
}

.btn-outline-primary {
    border: 1px solid var(--primary);
    background-color: transparent;
    color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary-light);
}

.btn-ghost {
    background-color: transparent;
    color: var(--foreground);
}

.btn-ghost:hover {
    background-color: var(--secondary);
}

.btn-destructive {
    background-color: var(--destructive);
    color: var(--destructive-foreground);
}

.btn-destructive:hover {
    background-color: #DC2626;
}

/* ==========================================
   Cards (shadcn/ui style)
   ========================================== */
.card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 1.5rem 1.5rem 0;
}

.card-content {
    padding: 1.5rem;
}

.card-footer {
    padding: 0 1.5rem 1.5rem;
}

/* ==========================================
   Forms (shadcn/ui style)
   ========================================== */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 0.375rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    height: 2.75rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--foreground);
    background-color: var(--card);
    border: 1px solid var(--input);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--muted-foreground);
}

.form-input-lg {
    height: 3rem;
    font-size: 1rem;
}

.form-textarea {
    height: auto;
    min-height: 5rem;
    padding: 0.75rem;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* ==========================================
   Navigation (Home page)
   ========================================== */
.nav-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background-color: white;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.nav-fixed.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

@media (min-width: 768px) {
    .nav-container {
        height: 5rem;
    }
}

.nav-logo {
    height: 3rem;
    width: auto;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

@media (min-width: 768px) {
    .nav-logo {
        height: 4rem;
    }
}

.nav-links {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

.nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

/* ==========================================
   Hero Section (Home page - Black background)
   ========================================== */
.hero-section {
    position: relative;
    background-color: #000000;
    padding-top: 6rem;
    padding-bottom: 4rem;
    overflow: hidden;
}

@media (min-width: 768px) {
    .hero-section {
        padding-top: 8rem;
        padding-bottom: 6rem;
    }
}

.hero-gradient-1 {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    animation: pulse-slow 8s ease-in-out infinite;
}

.hero-gradient-2 {
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    animation: pulse-slow 10s ease-in-out infinite reverse;
}

@keyframes pulse-slow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
}

.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
    color: white;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .hero-title {
        font-size: 2.25rem;
    }
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.75rem;
    }
}

@media (min-width: 1024px) {
    .hero-title {
        font-size: 4.5rem;
    }
}

.hero-title .highlight {
    color: var(--primary);
    text-shadow: 0 0 30px rgba(20, 184, 166, 0.5);
}

.hero-subtitle {
    font-size: 1rem;
    color: #D1D5DB;
    margin-bottom: 2rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 640px) {
    .hero-subtitle {
        font-size: 1.125rem;
    }
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 1.25rem;
    }
}

/* ==========================================
   Stats Section (Black background)
   ========================================== */
.stats-section {
    background-color: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem 0;
}

@media (min-width: 768px) {
    .stats-section {
        padding: 4rem 0;
    }
}

.stat-card {
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(20, 184, 166, 0.3);
}

@media (min-width: 768px) {
    .stat-card {
        padding: 1.5rem;
    }
}

.stat-value {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #2DD4BF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (min-width: 640px) {
    .stat-value {
        font-size: 2.25rem;
    }
}

@media (min-width: 768px) {
    .stat-value {
        font-size: 3rem;
    }
}

.stat-label {
    font-size: 0.75rem;
    color: #9CA3AF;
    font-weight: 500;
}

@media (min-width: 640px) {
    .stat-label {
        font-size: 0.875rem;
    }
}

/* ==========================================
   Features Section (White background)
   ========================================== */
.features-section {
    background-color: white;
    padding: 4rem 0;
}

@media (min-width: 768px) {
    .features-section {
        padding: 6rem 0;
    }
}

.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
    .section-title {
        font-size: 1.875rem;
    }
}

@media (min-width: 768px) {
    .section-title {
        font-size: 3rem;
    }
}

.section-subtitle {
    font-size: 1rem;
    color: var(--muted-foreground);
}

@media (min-width: 768px) {
    .section-subtitle {
        font-size: 1.125rem;
    }
}

.feature-card {
    position: relative;
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: linear-gradient(135deg, white, rgba(249, 250, 251, 0.5));
    transition: all 0.3s ease;
    overflow: hidden;
}

@media (min-width: 768px) {
    .feature-card {
        padding: 2rem;
    }
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(20, 184, 166, 0.1);
    border-color: rgba(20, 184, 166, 0.3);
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    position: relative;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--primary-light), rgba(20, 184, 166, 0.05));
    border: 1px solid rgba(20, 184, 166, 0.1);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .feature-icon {
        width: 3.5rem;
        height: 3.5rem;
        margin-bottom: 1.5rem;
    }
}

.feature-card:hover .feature-icon {
    border-color: rgba(20, 184, 166, 0.3);
    box-shadow: 0 8px 20px rgba(20, 184, 166, 0.2);
}

.feature-icon i,
.feature-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--primary);
}

.feature-title {
    position: relative;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

@media (min-width: 768px) {
    .feature-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
}

.feature-card:hover .feature-title {
    color: var(--primary);
}

.feature-description {
    position: relative;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--muted-foreground);
}

@media (min-width: 768px) {
    .feature-description {
        font-size: 1rem;
    }
}

/* ==========================================
   How It Works Section (Black background)
   ========================================== */
.how-it-works-section {
    background-color: #000000;
    padding: 4rem 0;
    overflow: hidden;
}

@media (min-width: 768px) {
    .how-it-works-section {
        padding: 6rem 0;
    }
}

.step-number {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 20px var(--primary-shadow);
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .step-number {
        width: 4rem;
        height: 4rem;
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

.step-number:hover {
    transform: scale(1.1) rotate(360deg);
}

.step-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .step-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
}

.step-description {
    font-size: 0.875rem;
    color: #9CA3AF;
}

@media (min-width: 768px) {
    .step-description {
        font-size: 1rem;
    }
}

/* ==========================================
   CTA Section
   ========================================== */
.cta-section {
    background-color: #000000;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .cta-section {
        padding: 6rem 0;
    }
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.05), rgba(20, 184, 166, 0.1), rgba(20, 184, 166, 0.05));
    animation: gradient-move 10s linear infinite;
}

@keyframes gradient-move {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    background-color: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem 0;
}

@media (min-width: 768px) {
    .footer {
        padding: 3rem 0;
    }
}

.footer-title {
    font-weight: 600;
    color: white;
    margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
    .footer-title {
        margin-bottom: 1rem;
    }
}

.footer-link {
    font-size: 0.875rem;
    color: #9CA3AF;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-bottom {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.75rem;
    color: #9CA3AF;
}

@media (min-width: 768px) {
    .footer-bottom {
        margin-top: 3rem;
        padding-top: 2rem;
        font-size: 0.875rem;
    }
}

/* ==========================================
   Auth Pages (Login/Register)
   ========================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-light), white, rgba(20, 184, 166, 0.1));
    overflow: hidden;
    position: relative;
}

.auth-gradient-1 {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    animation: pulse-slow 8s ease-in-out infinite;
}

.auth-gradient-2 {
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    animation: pulse-slow 10s ease-in-out infinite reverse;
}

.auth-card {
    width: 100%;
    max-width: 28rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    border: none;
    position: relative;
    z-index: 10;
}

@media (min-width: 640px) {
    .auth-card {
        padding: 2rem;
    }
}

.auth-logo {
    height: 3.5rem;
    margin: 0 auto 1rem;
    display: block;
    cursor: pointer;
    transition: transform 0.2s ease;
}

@media (min-width: 640px) {
    .auth-logo {
        height: 4rem;
    }
}

.auth-logo:hover {
    transform: scale(1.05);
}

.auth-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .auth-title {
        font-size: 1.875rem;
    }
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    text-align: center;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .auth-subtitle {
        font-size: 1rem;
    }
}

/* ==========================================
   Onboarding
   ========================================== */
.onboarding-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-light), white, rgba(20, 184, 166, 0.1));
    overflow: hidden;
    position: relative;
}

.onboarding-card {
    width: 100%;
    max-width: 32rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    border: none;
    position: relative;
    z-index: 10;
}

@media (min-width: 640px) {
    .onboarding-card {
        padding: 2rem;
    }
}

.progress-bar {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.progress-step {
    height: 0.5rem;
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
}

.progress-step.inactive {
    width: 1.5rem;
    background-color: var(--muted);
}

@media (min-width: 640px) {
    .progress-step.inactive {
        width: 2rem;
    }
}

.progress-step.active {
    width: 2.5rem;
    background-color: var(--primary);
}

@media (min-width: 640px) {
    .progress-step.active {
        width: 3rem;
    }
}

.interest-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background-color: transparent;
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.2s ease;
}

.interest-chip:hover {
    border-color: var(--primary);
}

.interest-chip.selected {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px var(--primary-shadow);
}

/* ==========================================
   Chat Layout
   ========================================== */
.chat-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background-color: #F9FAFB;
}

/* Sidebar */
.chat-sidebar {
    position: fixed;
    inset-y: 0;
    left: 0;
    z-index: 50;
    width: 18rem;
    display: flex;
    flex-direction: column;
    background-color: white;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 1024px) {
    .chat-sidebar {
        position: relative;
        width: 16rem;
        transform: translateX(0);
    }
}

.chat-sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 5rem;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    height: 3rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.sidebar-logo:hover {
    transform: scale(1.05);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

@media (min-width: 1024px) {
    .sidebar-overlay {
        display: none;
    }
}

.sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* User info in sidebar */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Conversation list */
.conversation-item {
    position: relative;
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
    background-color: white;
    border: 1px solid var(--border);
}

.conversation-item:hover {
    background-color: #F9FAFB;
    border-color: var(--muted);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.conversation-item.active {
    background: linear-gradient(135deg, var(--primary-light), rgba(20, 184, 166, 0.05));
    border-color: rgba(20, 184, 166, 0.3);
    box-shadow: 0 8px 20px rgba(20, 184, 166, 0.1);
}

.conversation-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), rgba(20, 184, 166, 0.6));
    border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.conversation-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.conversation-icon i,
.conversation-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: white;
}

.conversation-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.conversation-item.active .conversation-title {
    color: var(--foreground);
}

.conversation-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.conversation-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
}

.conversation-time {
    font-size: 0.625rem;
    color: var(--muted-foreground);
}

.conversation-delete {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.375rem;
    border-radius: var(--radius);
    background-color: #F3F4F6;
    border: 1px solid var(--border);
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.2s ease;
}

.conversation-delete:hover {
    background-color: #FEE2E2;
    border-color: #FECACA;
    color: #EF4444;
}

/* Chat main area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 4rem;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .chat-main {
        padding-bottom: 0;
    }
}

/* Chat header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.5rem;
    padding: 0 0.75rem;
    background-color: white;
    border-bottom: 1px solid var(--border);
}

@media (min-width: 1024px) {
    .chat-header {
        height: 5rem;
        padding: 0 1.5rem;
    }
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 1024px) {
    .chat-header-left {
        gap: 1rem;
    }
}

.mode-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (min-width: 1024px) {
    .mode-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
}

.mode-icon i,
.mode-icon svg {
    width: 1rem;
    height: 1rem;
    color: white;
}

@media (min-width: 1024px) {
    .mode-icon i,
    .mode-icon svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

.mode-info h1 {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
}

@media (min-width: 1024px) {
    .mode-info h1 {
        font-size: 1.125rem;
    }
}

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

@media (min-width: 1024px) {
    .mode-info p {
        font-size: 0.875rem;
    }
}

/* Chat messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    padding-bottom: 5rem;
}

@media (min-width: 1024px) {
    .chat-messages {
        padding: 1.5rem;
        padding-bottom: 1.5rem;
    }
}

.messages-container {
    max-width: 48rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .messages-container {
        gap: 1.25rem;
    }
}

/* Message bubbles */
.message {
    display: flex;
    gap: 0.5rem;
    animation: message-in 0.3s ease-out;
}

@media (min-width: 640px) {
    .message {
        gap: 0.75rem;
    }
}

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

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

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

.message-avatar {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .message-avatar {
        width: 2.5rem;
        height: 2.5rem;
    }
}

.message-user .message-avatar {
    background: linear-gradient(135deg, var(--primary), #14B8A6);
    box-shadow: 0 10px 25px var(--primary-shadow);
    order: 1;
}

.message-assistant .message-avatar {
    background: linear-gradient(135deg, var(--primary-light), rgba(20, 184, 166, 0.1));
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.1);
}

.message-avatar i,
.message-avatar svg {
    width: 1rem;
    height: 1rem;
}

@media (min-width: 640px) {
    .message-avatar i,
    .message-avatar svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

.message-user .message-avatar i,
.message-user .message-avatar svg {
    color: white;
}

.message-assistant .message-avatar i,
.message-assistant .message-avatar svg {
    color: var(--primary);
}

.message-content {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-xl);
    line-height: 1.5;
}

@media (min-width: 640px) {
    .message-content {
        max-width: 80%;
        padding: 0.75rem 1.25rem;
    }
}

.message-user .message-content {
    background: linear-gradient(135deg, var(--primary), #14B8A6);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 10px 25px var(--primary-shadow);
}

.message-assistant .message-content {
    background-color: white;
    color: var(--foreground);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.message-text {
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .message-text {
        font-size: 1rem;
    }
}

/* Markdown in messages */
.message-content p {
    margin-bottom: 0.75rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong {
    font-weight: 700;
}

.message-assistant .message-content strong {
    color: var(--foreground);
}

.message-content ul,
.message-content ol {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
}

.message-content li {
    margin-bottom: 0.375rem;
}

.message-content code:not(pre code) {
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    font-family: 'Monaco', 'Consolas', monospace;
    border-radius: 0.25rem;
}

@media (min-width: 640px) {
    .message-content code:not(pre code) {
        font-size: 0.875rem;
    }
}

.message-assistant .message-content code:not(pre code) {
    background-color: #F3F4F6;
    color: var(--foreground);
}

.message-user .message-content code:not(pre code) {
    background-color: rgba(255, 255, 255, 0.2);
}

.message-content pre {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background-color: #1F2937;
    color: #F3F4F6;
    border-radius: var(--radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.message-content pre code {
    display: block;
    white-space: pre;
    font-size: 0.75rem;
}

@media (min-width: 640px) {
    .message-content pre code {
        font-size: 0.875rem;
    }
}

.message-content blockquote {
    margin: 0.75rem 0;
    padding-left: 0.75rem;
    border-left: 4px solid var(--primary);
    font-style: italic;
    color: var(--muted-foreground);
}

.message-content h1,
.message-content h2,
.message-content h3 {
    font-family: 'Inter', sans-serif;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.message-content h1 { font-size: 1.25rem; }
.message-content h2 { font-size: 1.125rem; }
.message-content h3 { font-size: 1rem; }

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0.75rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary);
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(1); opacity: 0.5; }
    40% { transform: scale(1.5); opacity: 1; }
}

/* Chat input */
.chat-input-container {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

@media (min-width: 640px) {
    .chat-input-container {
        padding: 1rem;
    }
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    max-width: 48rem;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .chat-input-wrapper {
        gap: 0.75rem;
    }
}

.chat-textarea {
    flex: 1;
    min-height: 3rem;
    max-height: 7.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--foreground);
    background-color: rgba(249, 250, 251, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    resize: none;
    overflow-y: auto;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

@media (min-width: 640px) {
    .chat-textarea {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }
}

.chat-textarea:focus {
    outline: none;
    background-color: white;
    border-color: rgba(20, 184, 166, 0.5);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.chat-textarea::placeholder {
    color: var(--muted-foreground);
}

.chat-send-btn {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #14B8A6);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px var(--primary-shadow);
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .chat-send-btn {
        width: 3.5rem;
        height: 3.5rem;
    }
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.08);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.chat-send-btn i,
.chat-send-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Empty state */
.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 1rem;
}

.chat-empty-icon {
    width: 5rem;
    height: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-2xl);
    background: linear-gradient(135deg, var(--primary), #14B8A6);
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 40px var(--primary-shadow);
    animation: pulse-shadow 3s ease-in-out infinite;
}

@media (min-width: 1024px) {
    .chat-empty-icon {
        width: 6rem;
        height: 6rem;
    }
}

@keyframes pulse-shadow {
    0%, 100% { box-shadow: 0 10px 40px rgba(20, 184, 166, 0.3); }
    50% { box-shadow: 0 15px 50px rgba(20, 184, 166, 0.5); }
}

.chat-empty-icon i,
.chat-empty-icon svg {
    width: 2.5rem;
    height: 2.5rem;
    color: white;
}

@media (min-width: 1024px) {
    .chat-empty-icon i,
    .chat-empty-icon svg {
        width: 3rem;
        height: 3rem;
    }
}

.chat-empty-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

@media (min-width: 1024px) {
    .chat-empty-title {
        font-size: 1.5rem;
    }
}

.chat-empty-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    max-width: 28rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
    .chat-empty-description {
        font-size: 1rem;
    }
}

/* Mode cards */
.mode-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-width: 24rem;
    margin-top: 2rem;
}

.mode-card {
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid;
}

.mode-card:hover {
    transform: scale(1.03);
}

.mode-card-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.mode-card-icon i,
.mode-card-icon svg {
    width: 1rem;
    height: 1rem;
    color: white;
}

.mode-card-label {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Mode specific colors */
.mode-quick-doubt {
    background-color: var(--mode-quick-doubt-bg);
    border-color: var(--mode-quick-doubt-border);
}

.mode-quick-doubt .mode-card-icon,
.mode-quick-doubt .conversation-icon {
    background: var(--mode-quick-doubt-gradient);
}

.mode-quick-doubt .mode-card-label,
.mode-quick-doubt .conversation-mode {
    color: var(--mode-quick-doubt-text);
    background-color: var(--mode-quick-doubt-bg);
    border-color: var(--mode-quick-doubt-border);
}

.mode-exam-prep {
    background-color: var(--mode-exam-prep-bg);
    border-color: var(--mode-exam-prep-border);
}

.mode-exam-prep .mode-card-icon,
.mode-exam-prep .conversation-icon {
    background: var(--mode-exam-prep-gradient);
}

.mode-exam-prep .mode-card-label,
.mode-exam-prep .conversation-mode {
    color: var(--mode-exam-prep-text);
    background-color: var(--mode-exam-prep-bg);
    border-color: var(--mode-exam-prep-border);
}

.mode-revision {
    background-color: var(--mode-revision-bg);
    border-color: var(--mode-revision-border);
}

.mode-revision .mode-card-icon,
.mode-revision .conversation-icon {
    background: var(--mode-revision-gradient);
}

.mode-revision .mode-card-label,
.mode-revision .conversation-mode {
    color: var(--mode-revision-text);
    background-color: var(--mode-revision-bg);
    border-color: var(--mode-revision-border);
}

.mode-free-learning {
    background-color: var(--mode-free-learning-bg);
    border-color: var(--mode-free-learning-border);
}

.mode-free-learning .mode-card-icon,
.mode-free-learning .conversation-icon {
    background: var(--mode-free-learning-gradient);
}

.mode-free-learning .mode-card-label,
.mode-free-learning .conversation-mode {
    color: var(--mode-free-learning-text);
    background-color: var(--mode-free-learning-bg);
    border-color: var(--mode-free-learning-border);
}

/* Mobile bottom nav */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (min-width: 1024px) {
    .mobile-bottom-nav {
        display: none;
    }
}

.mobile-nav-items {
    display: flex;
    align-items: center;
    justify-content: space-around;
    max-width: 28rem;
    margin: 0 auto;
    padding: 0.25rem 0;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.5rem 0.75rem;
    color: var(--muted-foreground);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.mobile-nav-item:hover {
    color: var(--primary);
}

.mobile-nav-item i,
.mobile-nav-item svg {
    width: 1.25rem;
    height: 1.25rem;
}

.mobile-nav-item span {
    font-size: 0.625rem;
    font-weight: 500;
}

.mobile-nav-fab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.5rem 0.75rem;
}

.mobile-nav-fab-btn {
    width: 3rem;
    height: 3rem;
    margin-top: -1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #14B8A6);
    color: white;
    border: 4px solid white;
    box-shadow: 0 4px 12px var(--primary-shadow);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.mobile-nav-fab-btn:hover {
    transform: scale(1.1);
}

.mobile-nav-fab-btn i,
.mobile-nav-fab-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* ==========================================
   Utilities
   ========================================== */
.text-primary { color: var(--primary); }
.bg-primary { background-color: var(--primary); }
.text-muted { color: var(--muted-foreground); }

.hidden { display: none; }
.block { display: block; }
.flex { display: flex; }
.grid { display: grid; }

.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive utilities */
@media (min-width: 640px) {
    .sm\:hidden { display: none; }
    .sm\:block { display: block; }
    .sm\:flex { display: flex; }
}

@media (min-width: 768px) {
    .md\:hidden { display: none; }
    .md\:block { display: block; }
    .md\:flex { display: flex; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
    .lg\:hidden { display: none; }
    .lg\:block { display: block; }
    .lg\:flex { display: flex; }
}
