/* Chat Application Styles */

/* App Container and Layout */
.app-container {
    min-height: calc(100vh - 80px);
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.welcome-screen {
    max-width: 900px;
    width: 100%;
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin: 0 auto;
}

.welcome-content h1 {
    font-size: 2.5rem;
    color: var(--primary-navy);
    margin: 1.5rem 0 1rem;
    font-weight: 700;
}

.welcome-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.welcome-avatar {
    border-radius: 50%;
    margin-bottom: 1rem;
}

/* Variables */
:root {
    --chat-primary: #1a365d;
    --chat-secondary: #ff9500;
    --chat-bg: #f8fafc;
    --chat-white: #ffffff;
    --chat-gray-100: #f7fafc;
    --chat-gray-200: #edf2f7;
    --chat-gray-300: #e2e8f0;
    --chat-gray-400: #cbd5e0;
    --chat-gray-500: #a0aec0;
    --chat-gray-600: #718096;
    --chat-gray-700: #4a5568;
    --chat-gray-800: #2d3748;
    --chat-gray-900: #1a202c;
    --chat-blue: #3182ce;
    --chat-green: #38a169;
    --chat-red: #e53e3e;
    --chat-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --chat-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Consult Gapac Brand Colors */
    --gapac-primary: #1a2332;
    --gapac-secondary: #d4803e;
    --gapac-gold: #d4803e;
    --gapac-bronze: #b8741f;
    --gapac-blue: #2563eb;
    --gapac-green: #059669;
    
    /* TaxMate Engine Colors */
    --max-engine: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --optimax-engine: linear-gradient(135deg, #d4803e 0%, #b8741f 100%);
    
    /* Subscription Tier Gradients - Consult Gapac Themed */
    --free-gradient: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    --starter-gradient: linear-gradient(135deg, #d4803e 0%, #b8741f 100%);
    --pro-gradient: linear-gradient(135deg, #1a2332 0%, #2563eb 100%);
    --premium-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --white-label-gradient: linear-gradient(135deg, #d4803e 0%, #b8741f 100%);
}

/* User Account Menu Styles */
.user-menu {
    position: relative;
    margin-left: 1rem;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--chat-white);
    border: 1px solid var(--chat-gray-300);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    color: var(--chat-gray-700);
}

.user-avatar-btn:hover {
    background: var(--chat-gray-50);
    border-color: var(--chat-gray-400);
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    background: var(--gapac-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

.user-email {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: var(--chat-white);
    border: 1px solid var(--chat-gray-300);
    border-radius: 0.5rem;
    box-shadow: var(--chat-shadow-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.user-menu.active .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--chat-gray-200);
}

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

.user-plan {
    font-weight: 600;
    color: var(--gapac-primary);
    margin-bottom: 0.25rem;
}

.user-prompts {
    font-size: 0.875rem;
    color: var(--chat-gray-600);
}

.dropdown-menu {
    padding: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--chat-gray-700);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background: var(--chat-gray-50);
    color: var(--gapac-primary);
}

.dropdown-item i {
    width: 1rem;
    text-align: center;
}

.dropdown-item .fa-chevron-right {
    margin-left: auto;
}

/* Enhanced Progress Indicators */
.progress-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--chat-gray-300);
    border-top: 2px solid var(--chat-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

.typing-progress {
    display: flex;
    align-items: flex-start;
    margin: 8px 0;
    font-size: 12px;
    color: var(--chat-gray-600);
    line-height: 1.4;
}

.progress-text {
    font-style: italic;
    margin-left: 4px;
}

.typing-patience {
    margin: 6px 0;
    font-size: 12px;
}

.patience-text {
    color: var(--chat-gray-600);
    font-weight: 500;
}

.typing-message {
    font-weight: 500;
    color: var(--chat-gray-700);
    margin-bottom: 5px;
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Tax Information Formatting */
.tax-table-container {
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: white;
}

.tax-bracket-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tax-bracket-table thead {
    background: linear-gradient(135deg, #1a2332 0%, #2563eb 100%);
    color: white;
}

.tax-bracket-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tax-bracket-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.tax-bracket-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.tax-bracket-table tbody tr:hover {
    background: #f0f9ff;
    transition: background-color 0.2s ease;
}

.income-bracket {
    font-weight: 500;
    color: #374151;
}

.tax-rate {
    font-weight: 600;
    color: #059669;
}

.currency-amount {
    color: #d4803e;
    font-weight: 600;
    font-family: 'SF Mono', Consolas, monospace;
    background: rgba(212, 128, 62, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.percentage {
    color: #059669;
    font-weight: 600;
    background: rgba(5, 150, 105, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.tax-section-header {
    color: #1a2332;
    font-size: 16px;
    font-weight: 700;
    margin: 20px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #d4803e;
    display: inline-block;
}

.tax-highlight {
    background: linear-gradient(135deg, #d4803e, #b8741f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.tax-paragraph {
    margin: 12px 0;
    line-height: 1.6;
    color: #374151;
}

.tax-list-item {
    margin: 8px 0;
    padding: 8px 12px;
    background: #f8fafc;
    border-left: 3px solid #d4803e;
    border-radius: 4px;
}

.list-number {
    color: #d4803e;
    font-weight: 700;
    margin-right: 8px;
}

.tax-separator {
    margin: 6px 0;
    padding: 6px 0;
    border-top: 1px dashed #e5e7eb;
}

.tax-explanation {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 8px;
    border-left: 4px solid #0ea5e9;
}

.tax-explanation p {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Message Content Enhancements */
.message-text {
    line-height: 1.6;
}

.message-text code {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 13px;
}

.message-text h4 {
    margin-top: 16px;
    margin-bottom: 8px;
}

.message-text table {
    margin: 16px 0;
}

/* Responsive Design for Tax Tables */
@media (max-width: 768px) {
    .tax-bracket-table {
        font-size: 12px;
    }
    
    .tax-bracket-table th,
    .tax-bracket-table td {
        padding: 8px 12px;
    }
    
    .currency-amount,
    .percentage {
        font-size: 11px;
        padding: 1px 4px;
    }
    
    .tax-section-header {
        font-size: 14px;
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--chat-bg);
    color: var(--chat-gray-800);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navigation */
.chat-nav {
    background: var(--chat-white);
    border-bottom: 1px solid var(--chat-gray-200);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--chat-shadow);
}

/* Premium Button Styling */
.btn.premium {
    background: linear-gradient(135deg, #ff9500 0%, #ff6b00 100%);
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(255, 149, 0, 0.3);
}

.btn.premium::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ffd700, #ff9500, #ffd700, #ff9500);
    border-radius: 10px;
    z-index: -1;
    animation: premium-glow 2s ease-in-out infinite alternate;
}

@keyframes premium-glow {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.btn.premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 149, 0, 0.4);
}

/* Upgrade Notice Styling */
.upgrade-notice {
    background: linear-gradient(135deg, #fff9f0 0%, #ffffff 100%);
    border: 1px solid #ff9500;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #d97706;
}

.upgrade-notice i {
    color: #ff9500;
}

.upgrade-link {
    color: #ff9500;
    font-weight: 600;
    text-decoration: none;
}

.upgrade-link:hover {
    text-decoration: underline;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--chat-primary);
}

.brand-subtitle {
    font-size: 0.875rem;
    color: var(--chat-gray-600);
}

.nav-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--chat-gray-100);
    border: 1px solid var(--chat-gray-300);
    border-radius: 8px;
    color: var(--chat-gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--chat-gray-200);
    border-color: var(--chat-gray-400);
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    padding-top: 80px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--chat-white);
    border-right: 1px solid var(--chat-gray-200);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    position: fixed;
    top: 80px;
    left: 0;
    bottom: 0;
    z-index: 999;
}

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

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--chat-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--chat-gray-800);
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--chat-gray-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    background: var(--chat-gray-100);
    color: var(--chat-gray-700);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.chat-item {
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.chat-item:hover {
    background: var(--chat-gray-100);
}

.chat-item.active {
    background: var(--chat-secondary);
    color: white;
}

.chat-preview {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-title {
    font-weight: 500;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-time {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Main Chat Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--chat-white);
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

.chat-main.sidebar-open {
    margin-left: 280px;
}

/* Welcome Screen */
.welcome-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.welcome-content {
    text-align: center;
    max-width: 600px;
}

.welcome-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 2rem;
    box-shadow: var(--chat-shadow-lg);
}

.welcome-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--chat-primary);
    margin-bottom: 1rem;
}

.welcome-content p {
    font-size: 1.125rem;
    color: var(--chat-gray-600);
    margin-bottom: 3rem;
}

.quick-actions h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--chat-gray-800);
    margin-bottom: 1.5rem;
}

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

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 1rem;
    background: var(--chat-white);
    border: 2px solid var(--chat-gray-200);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.action-card:hover {
    border-color: var(--chat-secondary);
    transform: translateY(-2px);
    box-shadow: var(--chat-shadow-lg);
}

.action-card i {
    font-size: 2rem;
    color: var(--chat-secondary);
}

.action-card span {
    font-weight: 600;
    color: var(--chat-gray-700);
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Subscription Tier Chat Backgrounds */
.chat-container.free-tier {
    background: var(--free-gradient);
}

.chat-container.starter-tier {
    background: var(--starter-gradient);
}

.chat-container.pro-tier {
    background: var(--pro-gradient);
}

.chat-container.premium-tier {
    background: var(--premium-gradient);
}

.chat-container.white-label-tier {
    background: var(--white-label-gradient);
}

/* Premium Overlay Effects */
.chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(1px);
    z-index: 1;
}

.chat-container.premium-tier::before,
.chat-container.white-label-tier::before {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(2px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

/* Premium Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.premium-shimmer {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}

/* Message Styles */
.message {
    display: flex;
    gap: 1rem;
    max-width: 80%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 3px solid transparent;
}

/* Premium Avatar Effects Based on Engine and Tier */
.premium-tier .message:not(.user) .message-avatar,
.white-label-tier .message:not(.user) .message-avatar {
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.8);
    border: 5px solid transparent;
    background: var(--max-engine);
    background-clip: padding-box;
    animation: avatarPulse 2s infinite alternate;
}

.white-label-tier .message:not(.user) .message-avatar {
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.9);
    background: var(--optimax-engine);
    animation: avatarPulseGold 1.5s infinite alternate;
}

/* Avatar Shimmer Effect for Premium Tiers */
.premium-tier .message:not(.user) .message-avatar::before,
.white-label-tier .message:not(.user) .message-avatar::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: conic-gradient(from 0deg, transparent, rgba(16, 185, 129, 1), transparent, rgba(16, 185, 129, 1), transparent);
    border-radius: 50%;
    animation: avatarRotate 2s linear infinite;
    z-index: -1;
}

.white-label-tier .message:not(.user) .message-avatar::before {
    background: conic-gradient(from 0deg, transparent, rgba(212, 175, 55, 1), transparent, rgba(212, 175, 55, 1), transparent);
    animation: avatarRotate 1.5s linear infinite;
}

/* Avatar Glow Animation */
@keyframes avatarRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes avatarPulse {
    0% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.7);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 30px rgba(16, 185, 129, 1);
        transform: scale(1.05);
    }
}

@keyframes avatarPulseGold {
    0% {
        box-shadow: 0 0 25px rgba(212, 175, 55, 0.8);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 35px rgba(212, 175, 55, 1);
        transform: scale(1.08);
    }
}

/* BIR Quick Links Panel */
.bir-panel {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    border: 2px solid var(--primary-orange);
    transition: transform 0.3s ease;
}

.bir-panel.collapsed {
    transform: translateX(-240px);
}

.bir-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-orange), var(--secondary-orange));
    color: white;
    border-radius: 10px 10px 0 0;
}

.bir-panel-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bir-panel-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bir-panel-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.bir-panel.collapsed .bir-panel-toggle i {
    transform: rotate(0deg);
}

.bir-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 1rem;
}

.bir-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: var(--primary-navy);
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

.bir-link:hover {
    background: linear-gradient(135deg, #fff5e6, #ffebe0);
    color: var(--primary-orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.2);
    border-color: var(--primary-orange);
}

.bir-link i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    color: var(--primary-orange);
}

.bir-link span {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

/* Mobile responsiveness for BIR panel */
@media (max-width: 768px) {
    .bir-panel {
        position: fixed;
        top: auto;
        bottom: 20px;
        right: 20px;
        left: 20px;
        width: auto;
    }
    
    .bir-panel.collapsed {
        transform: translateY(calc(100% - 60px));
    }
    
    .bir-links-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .bir-link {
        padding: 0.5rem;
    }
    
    .bir-link span {
        font-size: 0.7rem;
    }
}

/* Engine-Specific Avatar Styling */
.max-engine-avatar {
    border: 2px solid var(--gapac-green);
    box-shadow: 0 0 15px rgba(5, 150, 105, 0.4);
}

.optimax-engine-avatar {
    border: 2px solid var(--gapac-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.message-content {
    background: var(--chat-gray-100);
    padding: 1rem 1.25rem;
    border-radius: 18px;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.message.user .message-content {
    background: var(--chat-secondary);
    color: white;
}

/* Premium Message Styling Based on Subscription Tiers */
.free-tier .message:not(.user) .message-content {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border: 2px solid #cbd5e0;
}

.starter-tier .message:not(.user) .message-content {
    background: linear-gradient(135deg, #fdf2f8, #f3e8ff);
    border: 2px solid var(--starter-gradient);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.2);
}

.pro-tier .message:not(.user) .message-content {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid var(--pro-gradient);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.2);
}

.premium-tier .message:not(.user) .message-content {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 2px solid var(--premium-gradient);
    box-shadow: 0 6px 20px rgba(67, 233, 123, 0.3);
    position: relative;
    overflow: hidden;
}

.premium-tier .message:not(.user) .message-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.8),
        transparent
    );
    animation: shimmer 2s infinite;
    z-index: 1;
    pointer-events: none;
}

.white-label-tier .message:not(.user) .message-content {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 2px solid var(--white-label-gradient);
    box-shadow: 0 8px 25px rgba(250, 112, 154, 0.4);
    position: relative;
    overflow: hidden;
}

.white-label-tier .message:not(.user) .message-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--white-label-gradient);
    border-radius: 20px;
    z-index: -1;
}

.white-label-tier .message:not(.user) .message-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 215, 0, 0.9),
        transparent
    );
    animation: shimmer 1.8s infinite;
    z-index: 1;
    pointer-events: none;
}

.message-text {
    font-size: 0.9375rem;
    line-height: 1.5;
}

.message-time {
    font-size: 0.75rem;
    color: var(--chat-gray-500);
    margin-top: 0.5rem;
}

.message.user .message-time {
    color: rgba(255, 255, 255, 0.8);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 1rem;
    max-width: 80%;
}

.typing-content {
    background: var(--chat-gray-100);
    padding: 1rem 1.25rem;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--chat-gray-500);
    border-radius: 50%;
    animation: typing 0.8s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Input Area */
.input-area {
    border-top: 2px solid var(--chat-secondary);
    padding: 1.5rem;
    background: var(--chat-white);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    background: #ffffff;
    border: 3px solid var(--chat-secondary);
    border-radius: 24px;
    padding: 1rem 1.25rem;
    transition: border-color 0.2s ease;
    position: relative;
    z-index: 100;
    max-width: 800px;
    margin: 0 auto;
}

.input-container:focus-within {
    border-color: var(--chat-secondary);
}

.attachment-btn {
    background: none;
    border: none;
    color: var(--chat-gray-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.attachment-btn:hover {
    background: var(--chat-gray-200);
    color: var(--chat-gray-700);
}

#message-input {
    flex: 1;
    border: none;
    background: #ffffff;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    max-height: 120px;
    min-height: 50px;
    padding: 10px;
    color: #333;
    font-weight: 400;
    border-radius: 8px;
    box-shadow: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Premium Input Field Styling */
.starter-tier .input-textarea,
.starter-tier #message-input {
    border: 2px solid var(--starter-gradient);
    box-shadow: 0 2px 8px rgba(240, 147, 251, 0.1);
}

.pro-tier .input-textarea,
.pro-tier #message-input {
    border: 2px solid var(--pro-gradient);
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.1);
}

.premium-tier .input-textarea,
.premium-tier #message-input {
    border: 2px solid var(--premium-gradient);
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.2);
    background: linear-gradient(135deg, #ffffff, #f0fdf4);
}

.white-label-tier .input-textarea,
.white-label-tier #message-input {
    border: 3px solid var(--white-label-gradient);
    box-shadow: 0 6px 20px rgba(250, 112, 154, 0.3);
    background: linear-gradient(135deg, #ffffff, #fffbeb);
    position: relative;
}

.send-btn {
    background: var(--chat-secondary);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Premium Send Button Styling */
.premium-tier .send-btn {
    background: var(--premium-gradient);
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.3);
}

.white-label-tier .send-btn {
    background: var(--white-label-gradient);
    box-shadow: 0 6px 20px rgba(250, 112, 154, 0.4);
}

.white-label-tier .send-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 2s infinite;
}

.send-btn:hover {
    background: #e88900;
    transform: scale(1.1) translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 149, 0, 0.3);
}

.premium-tier .send-btn:hover {
    background: var(--premium-gradient);
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 233, 123, 0.4);
}

.white-label-tier .send-btn:hover {
    background: var(--white-label-gradient);
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 8px 25px rgba(250, 112, 154, 0.5);
}

.send-btn:disabled {
    background: var(--chat-gray-400);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.input-footer {
    margin-top: 0.75rem;
    text-align: center;
}

.disclaimer {
    font-size: 0.75rem;
    color: var(--chat-gray-500);
    font-style: italic;
}

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
}

.search-content {
    background: var(--chat-white);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--chat-shadow-lg);
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--chat-gray-200);
}

.search-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--chat-gray-800);
}

.search-close {
    background: none;
    border: none;
    color: var(--chat-gray-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.search-close:hover {
    background: var(--chat-gray-100);
    color: var(--chat-gray-700);
}

.search-input-container {
    display: flex;
    padding: 1.5rem;
    gap: 0.75rem;
}

#search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--chat-gray-200);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

#search-input:focus {
    border-color: var(--chat-secondary);
}

.search-submit {
    background: var(--chat-secondary);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.search-submit:hover {
    background: #e88900;
}

.search-results {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.search-categories h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--chat-gray-800);
    margin-bottom: 1rem;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-tag {
    padding: 0.5rem 1rem;
    background: var(--chat-gray-100);
    color: var(--chat-gray-700);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-tag:hover {
    background: var(--chat-secondary);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-actions .nav-btn span {
        display: none;
    }
    
    .nav-actions .nav-btn {
        padding: 0.5rem;
        width: 40px;
        justify-content: center;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .chat-main.sidebar-open {
        margin-left: 0;
    }
    
    .welcome-content h1 {
        font-size: 2rem;
    }
    
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .message {
        max-width: 95%;
    }
    
    .brand-subtitle {
        display: none;
    }
}

@media (max-width: 480px) {
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .input-area {
        padding: 1rem;
    }
    
    .chat-messages {
        padding: 1rem;
    }
}