:root {
    --primary: #d4af37;
    --primary-dark: #b8941e;
    --primary-light: rgba(212, 175, 55, 0.15);
    --secondary: #8b7355;
    --success: #2d8659;
    --warning: #d4af37;
    --error: #c41e3a;
    --background: rgba(26, 20, 16, 0.95);
    --surface: rgba(40, 32, 26, 0.85);
    --text-primary: #fef5e7;
    --text-secondary: #e8dcc8;
    --border: rgba(212, 175, 55, 0.2);
    --shadow: 0 20px 40px -5px rgba(212, 175, 55, 0.3);
    --glass-border: 1px solid rgba(212, 175, 55, 0.3);
    --sidebar-width: 280px;
    --header-height: 56px;
    --gold-shine: linear-gradient(135deg, #d4af37 0%, #f4e5b8 50%, #d4af37 100%);
    --dark-bg: #1a1410;
}

.light-mode {
    --primary: #d4af37;
    --primary-dark: #b8941e;
    --primary-light: rgba(212, 175, 55, 0.1);
    --secondary: #8b7355;
    --success: #2d8659;
    --warning: #d4af37;
    --error: #c41e3a;
    --background: rgba(245, 238, 225, 0.92);
    --surface: rgba(250, 243, 230, 0.82);
    --text-primary: #1a1410;
    --text-secondary: #3d2f1f;
    --border: rgba(212, 175, 55, 0.25);
    --shadow: 0 20px 40px -5px rgba(212, 175, 55, 0.15);
    --glass-border: 1px solid rgba(212, 175, 55, 0.35);
    --dark-bg: #1a1410;
}

.light-mode body {
    background: linear-gradient(135deg, #f5ede0 0%, #ebe0d0 50%, #f5ede0 100%);
}

.light-mode body::before {
    background: radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.04) 0%, transparent 50%);
}

.pure-light-mode {
    --primary: #c9a236;
    --primary-dark: #a68825;
    --primary-light: rgba(201, 162, 54, 0.12);
    --secondary: #7a6348;
    --success: #28a745;
    --warning: #ffc107;
    --error: #dc3545;
    --background: #f8f9fa;
    --surface: #ffffff;
    --text-primary: #2d2d2d;
    --text-secondary: #5a5a5a;
    --border: rgba(0, 0, 0, 0.1);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --glass-border: 1px solid rgba(0, 0, 0, 0.1);
    --dark-bg: #212529;
}

.pure-light-mode body {
    background: #f5f5f5 !important;
}

.pure-light-mode body::before {
    display: none !important;
}

.pure-light-mode .sidebar {
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
}

.pure-light-mode .header {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

.pure-light-mode .chat-messages {
    background: #f5f5f5;
}

.pure-light-mode .message.ai .message-content {
    background: #ffffff;
    border: 1px solid #e0e0e0;
}

.pure-light-mode .market-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
}

.pure-light-mode .analysis-container {
    background: #ffffff;
    border: 1px solid #e0e0e0;
}

.pure-light-mode .chat-input-wrapper {
    background: #ffffff !important;
    border: 1px solid #d0d0d0 !important;
}

.pure-light-mode .chat-input-wrapper::before {
    display: none !important;
}

.pure-light-mode .chip {
    background: #ffffff;
    border: 1px solid #d0d0d0;
}

.pure-light-mode .chat-input-container {
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
}

.pure-light-mode .ai-disclaimer {
    background: rgba(0, 0, 0, 0.05);
    color: #6c757d;
}

.dark-mode {
    --primary: #f4d03f;
    --primary-dark: #d4af37;
    --primary-light: rgba(244, 208, 63, 0.2);
    --background: rgba(15, 12, 10, 0.98);
    --surface: rgba(30, 24, 20, 0.9);
    --text-primary: #fef5e7;
    --text-secondary: #d4c5a9;
    --border: rgba(244, 208, 63, 0.25);
    --shadow: 0 20px 40px -5px rgba(244, 208, 63, 0.4);
}

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

/* PERFORMANCE BOOST - Hardware Acceleration */
.sidebar,
.main-content,
.chat-messages,
.message,
.profile-modal,
.header {
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1a1410 0%, #2d2416 50%, #1a1410 100%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

#app {
    display: flex;
    height: 100vh;
    backdrop-filter: blur(20px);
    overflow: hidden;
}

/* Enhanced Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: var(--glass-border);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    position: relative;
    will-change: transform;
    border-top: none;
    border-bottom: none;
    border-left: none;
}

.sidebar.hidden {
    transform: translateX(-100%);
    position: absolute;
    left: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: var(--glass-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    border-top: none;
    border-left: none;
    border-right: none;
    position: relative;
    overflow: hidden;
}

.sidebar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.05), transparent);
    animation: premiumSweep 8s ease-in-out infinite;
}

@keyframes premiumSweep {
    0%, 100% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gold-shine);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-bg);
    font-size: 1.2rem;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    animation: premiumPulse 4s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 14px;
    background: linear-gradient(45deg, transparent, rgba(212, 175, 55, 0.4), transparent);
    animation: premiumRotate 3s linear infinite;
    opacity: 0;
}

.logo-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: inherit;
    filter: blur(12px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.logo-icon:hover {
    transform: translateY(-1px) scale(1.03);
}

.logo-icon:hover::before {
    opacity: 1;
}

.logo-icon:hover::after {
    opacity: 0.5;
}

@keyframes premiumPulse {
    0%, 100% {
        box-shadow: 0 8px 20px rgba(212, 175, 55, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 12px 30px rgba(212, 175, 55, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 20px rgba(212, 175, 55, 0.3);
    }
}

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

.light-mode .logo-icon {
    background: linear-gradient(135deg, #a68825 0%, #c9a84a 50%, #a68825 100%);
    box-shadow: 0 8px 20px rgba(166, 136, 37, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(139, 112, 20, 0.3);
}

.light-mode .logo-icon::before {
    background: linear-gradient(45deg, transparent, rgba(166, 136, 37, 0.4), transparent);
}

.light-mode .logo-icon::after {
    background: linear-gradient(135deg, #a68825 0%, #c9a84a 50%, #a68825 100%);
}

.pure-light-mode .logo-icon {
    background: linear-gradient(135deg, #c9a236 0%, #e0c060 50%, #c9a236 100%);
    box-shadow: 0 8px 20px rgba(201, 162, 54, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(201, 162, 54, 0.3);
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    background: var(--gold-shine);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: premiumShimmer 3s ease-in-out infinite;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    letter-spacing: -0.01em;
}

.logo-text::first-letter {
    background: var(--gold-shine);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    background-clip: text;
    -webkit-background-clip: text;
    filter: blur(6px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.logo-text::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    animation: premiumUnderline 4s ease-in-out infinite;
}

.logo-text:hover {
    transform: translateX(1px);
}

.logo-text:hover::before {
    opacity: 0.6;
}

@keyframes premiumShimmer {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

@keyframes premiumUnderline {
    0%, 90%, 100% {
        opacity: 0;
        transform: scaleX(0);
    }
    45%, 55% {
        opacity: 0.6;
        transform: scaleX(1);
    }
}

.light-mode .logo-text {
    background: linear-gradient(135deg, #8b6f1a 0%, #a68825 50%, #8b6f1a 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.light-mode .logo-text::before {
    background: linear-gradient(135deg, #8b6f1a 0%, #a68825 50%, #8b6f1a 100%);
    background-size: 200% auto;
}

.light-mode .logo-text::after {
    background: linear-gradient(90deg, transparent, #a68825, transparent);
}

.pure-light-mode .logo-text {
    background: linear-gradient(135deg, #a68825 0%, #c9a236 50%, #a68825 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-subtitle {
    font-size: 0.65rem;
    color: #e8dcc8;
    margin-top: 2px;
}

.light-mode .logo-subtitle {
    color: #3d2f1f !important;
    font-weight: 700;
}

.pure-light-mode .logo-subtitle {
    color: #5a5a5a !important;
    font-weight: 600;
}

.light-mode .sidebar-header::before {
    background: linear-gradient(90deg, transparent, rgba(166, 136, 37, 0.08), transparent);
}

.new-chat-btn {
    margin: 1rem;
    background: var(--gold-shine);
    color: var(--dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.new-chat-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    animation: goldShine 3s infinite;
}

@keyframes goldShine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #e8dcc8;
    margin-bottom: 0.75rem;
    letter-spacing: 1px;
}

.light-mode .nav-title {
    color: #3d2f1f !important;
    font-weight: 800;
}

.pure-light-mode .nav-title {
    color: #5a5a5a !important;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    margin-bottom: 0.3rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    color: #e8dcc8;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    will-change: transform;
}

.light-mode .nav-item {
    color: #3d2f1f !important;
    font-weight: 700;
}

.pure-light-mode .nav-item {
    color: #5a5a5a !important;
    font-weight: 600;
}

.nav-item:hover,
.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    transform: translate3d(5px, 0, 0);
}

.nav-item i {
    width: 18px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    width: 100%;
}

.header {
    height: var(--header-height);
    padding: 0 1.5rem;
    border-bottom: var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    backdrop-filter: blur(10px);
    will-change: transform;
    border-top: none;
    border-left: none;
    border-right: none;
}

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

.header-title {
    font-size: 0.9rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-subtitle {
    font-size: 0.65rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle,
.icon-btn {
    background: var(--background);
    border: var(--glass-border);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    font-size: 0.9rem;
    will-change: transform;
}

.theme-toggle:hover,
.icon-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translate3d(0, -2px, 0);
}

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

.chat-messages {
    flex: 1;
    padding: 0.75rem 0.875rem;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.message {
    display: flex;
    gap: 0.4rem;
    max-width: 78%;
    animation: messageSlide 0.3s ease;
    will-change: transform, opacity;
}

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

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.message-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 0.7rem;
}

.message.user .message-avatar {
    background: var(--gold-shine);
    color: var(--dark-bg);
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message.ai .message-avatar {
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
}

.message-content {
    background: var(--surface);
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    will-change: transform;
    position: relative;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.message-content p {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.message-content p + p {
    margin-top: 0.4rem;
}

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

.message-content li {
    margin: 0.2rem 0;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.message-content code {
    font-size: 0.75rem;
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.2);
}

.message-content pre {
    margin: 0.4rem 0;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    line-height: 1.35;
}

/* Message Action Buttons */
.message-actions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border);
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
}

.message:hover .message-actions {
    opacity: 1;
    transform: translateY(0);
}

.action-btn {
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.action-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn i {
    font-size: 0.8rem;
}

/* Feedback button colors */
.action-btn:has(.fa-thumbs-up.fas) {
    color: var(--success) !important;
}

.action-btn:has(.fa-thumbs-down.fas) {
    color: var(--error) !important;
}

.action-btn:has(.fa-star.fas) {
    color: var(--primary) !important;
}

.action-btn:has(.fa-stop) {
    color: var(--primary) !important;
    animation: pulse 1s infinite;
}

/* Voice Mode Active */
.voice-mode-btn.active {
    background: var(--primary) !important;
    color: var(--dark-bg) !important;
    animation: voicePulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes voicePulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(212, 175, 55, 0);
    }
}

.message.user .message-content {
    background: var(--gold-shine);
    color: var(--dark-bg);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message-text {
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    font-size: 0.875rem;
}

.message-text strong {
    font-size: 0.9rem;
}

/* Market Overview */
.market-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin: 0.85rem 0;
}

.market-card {
    background: var(--background);
    border-radius: 10px;
    padding: 1rem;
    border: var(--glass-border);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

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

.market-title {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.market-value {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.market-change {
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.market-change.positive {
    color: var(--success);
}

.market-change.negative {
    color: var(--error);
}

/* Analysis Container */
.analysis-container {
    margin-top: 1rem;
    border: var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface);
    backdrop-filter: blur(20px);
}

.analysis-header {
    background: var(--background);
    padding: 1rem;
    border-bottom: var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stock-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stock-symbol {
    font-weight: 800;
    font-size: 1.2rem;
}

.stock-price {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--success);
}

.analysis-content {
    padding: 1rem;
}

.analysis-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-card {
    background: var(--background);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    border: var(--glass-border);
    transition: all 0.3s ease;
}

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

.metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--gold-shine);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.advanced-chart {
    height: 250px;
    margin: 1rem 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--background);
    border: var(--glass-border);
}

/* Profile Modal Styles */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, rgba(26, 20, 16, 0.95), rgba(45, 36, 22, 0.95));
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    overflow-y: auto;
    padding: 1rem;
}

.profile-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 40%, rgba(212, 175, 55, 0.15) 0%, transparent 60%),
                radial-gradient(circle at 70% 70%, rgba(212, 175, 55, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

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

.profile-container {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    backdrop-filter: blur(30px);
    border: 2px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 30px 60px -10px rgba(212, 175, 55, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
    margin: auto;
}

.profile-modal.active .profile-container {
    transform: translateY(0) scale(1);
}

.profile-header {
    text-align: center;
    margin-bottom: 0.75rem;
}

.profile-logo {
    width: 40px;
    height: 40px;
    background: var(--gold-shine);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-bg);
    font-size: 1.25rem;
    margin: 0 auto 0.375rem;
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.profile-logo::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 11px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.5), transparent, rgba(212, 175, 55, 0.5));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderRotate 3s linear infinite;
}

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

.profile-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.profile-subtitle {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 0;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--error);
    color: white;
}

.back-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

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

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-label {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.form-input {
    padding: 0.5625rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.8125rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-weight: 500;
    line-height: 1.3;
}

.form-input:hover {
    border-color: rgba(212, 175, 55, 0.4);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12), 0 4px 12px rgba(212, 175, 55, 0.15);
    transform: translateY(-1px);
}

.form-input::placeholder { 
    color: var(--text-secondary);
    opacity: 0.5;
    font-size: 0.75rem;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-input {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--primary);
}

.error-message {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 0.2rem;
    display: none;
    font-weight: 500;
}

.error-message:not(:empty) {
    display: block;
}

.form-input.error {
    border-color: #ef4444;
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.auth-btn {
    background: var(--gold-shine);
    color: var(--dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.6875rem 1rem;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-btn .loading-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top: 2px solid var(--dark-bg);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

.auth-btn.loading .loading-spinner {
    display: inline-block;
}

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

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.auth-divider span {
    color: var(--text-secondary);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    white-space: nowrap;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.125rem 0;
}

.remember-me input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    background: var(--background);
}

.remember-me input[type="checkbox"]:hover {
    border-color: var(--primary);
}

.remember-me input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.remember-me input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--dark-bg);
    font-size: 11px;
    font-weight: 700;
}

.remember-me label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}

.remember-me:hover label {
    color: var(--text-primary);
}

.auth-footer {
    margin-top: 0.5rem;
    text-align: center;
}

.auth-footer p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.3rem 0;
    line-height: 1.3;
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
}

.auth-link:hover {
    color: var(--gold-shine);
    text-decoration: underline;
}

.auth-link:active {
    transform: scale(0.98);
}

.biometric-btn {
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
    position: relative;
    overflow: hidden;
}

.biometric-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.biometric-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.2);
}

.biometric-btn:hover::before {
    transform: translateX(100%);
}

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    line-height: 1.5;
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

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

.security-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding: 0.65rem 0.85rem;
    background: rgba(45, 134, 89, 0.1);
    border: 1px solid rgba(45, 134, 89, 0.3);
    border-radius: 10px;
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.security-indicator i {
    font-size: 0.9rem;
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

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

/* 2FA/MFA Styles */
.mfa-container {
    display: none;
}

.mfa-container.active {
    display: block;
}

.otp-input-group {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.otp-input {
    width: 50px;
    height: 55px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--background);
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
}

.otp-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.mfa-methods {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.mfa-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--background);
}

.mfa-method:hover,
.mfa-method.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.mfa-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 1.2rem;
}

.mfa-info h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.mfa-info p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    margin-top: 1rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* Accessibility Enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border: #000000;
        --text-secondary: #000000;
    }
    
    .dark-mode {
        --border: #ffffff;
        --text-secondary: #ffffff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Chat Input */
.chat-input-container {
    padding: 0.5rem 0.875rem;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    background: linear-gradient(180deg, 
        rgba(26, 20, 16, 0.6) 0%, 
        rgba(40, 32, 26, 0.7) 100%);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    position: relative;
    border-left: none;
    border-right: none;
    border-bottom: none;
}

.chat-input-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(212, 175, 55, 0.3) 50%, 
        transparent 100%);
    pointer-events: none;
}

.light-mode .chat-input-container {
    background: linear-gradient(180deg, 
        rgba(245, 238, 225, 0.7) 0%, 
        rgba(250, 243, 230, 0.8) 100%);
}

/* Quick Analysis Chips */
.quick-chips {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 0.4rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.1rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
}

.quick-chips::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(90deg, transparent 0%, var(--background) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-chips:hover::after {
    opacity: 1;
}

.quick-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.625rem;
    background: rgba(40, 32, 26, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.chip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(212, 175, 55, 0.1) 0%, 
        transparent 50%, 
        rgba(212, 175, 55, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chip:hover::before {
    opacity: 1;
}

.chip i {
    font-size: 0.8rem;
    color: var(--primary);
    position: relative;
    z-index: 1;
}

.chip span {
    position: relative;
    z-index: 1;
}

.light-mode .chip {
    background: rgba(250, 243, 230, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.25);
}

.chip:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.chip:active {
    transform: translateY(0);
}

.file-preview {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.file-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--background);
    border: var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.file-chip i {
    color: var(--primary);
}

.file-chip-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    margin-left: 0.25rem;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.file-chip-remove:hover {
    color: var(--error);
}

.chat-input-wrapper {
    background: rgba(40, 32, 26, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 14px;
    padding: 0.375rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 100%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1), 
                inset 0 1px 0 rgba(212, 175, 55, 0.1);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    position: relative;
}

.chat-input-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    padding: 1px;
    background: linear-gradient(135deg, 
        rgba(212, 175, 55, 0.3) 0%, 
        transparent 50%, 
        rgba(212, 175, 55, 0.2) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.light-mode .chat-input-wrapper {
    background: rgba(250, 243, 230, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.25);
}

.chat-input-wrapper:hover {
    box-shadow: 0 3px 16px rgba(212, 175, 55, 0.15), 
                inset 0 1px 0 rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.3);
}

.chat-input-wrapper:hover::before {
    opacity: 1;
}

.chat-input-wrapper:focus-within {
    background: rgba(40, 32, 26, 0.85);
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.25),
                0 0 0 1px var(--primary),
                inset 0 1px 0 rgba(212, 175, 55, 0.2);
}

.chat-input-wrapper:focus-within::before {
    opacity: 1;
}

.light-mode .chat-input-wrapper:focus-within {
    background: rgba(250, 243, 230, 0.95);
}

.chat-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 400;
    outline: none !important;
    box-shadow: none !important;
    resize: none;
    min-height: 20px;
    max-height: 100px;
    line-height: 1.45;
    padding: 0;
    margin: 0;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.chat-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
    font-weight: 400;
}

.input-action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.input-action-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: scale(1.05);
}

.input-action-btn.active {
    background: var(--primary);
    color: var(--dark-bg);
    transform: scale(1.05);
    animation: pulse 1.5s infinite;
}

.send-btn {
    background: var(--gold-shine);
    color: var(--dark-bg);
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
    flex-shrink: 0;
    font-size: 0.8rem;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 12px rgba(212, 175, 55, 0.5);
}

.send-btn:active {
    transform: scale(0.95);
}

/* Voice Recognition */
.voice-recognition {
    position: absolute;
    top: -180px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 
                0 0 0 1px rgba(212, 175, 55, 0.2);
    z-index: 1000;
    min-width: 280px;
    max-width: 90vw;
    pointer-events: auto;
    animation: slideDown 0.3s ease-out;
}

.voice-recognition::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    background: linear-gradient(135deg, 
        rgba(212, 175, 55, 0.3) 0%, 
        transparent 50%, 
        rgba(212, 175, 55, 0.2) 100%);
    z-index: -1;
    opacity: 0.5;
}

.voice-animation {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gold-shine);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-bg);
    margin-bottom: 1rem;
    animation: voicePulse 1.5s infinite;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.5), 
                inset 0 2px 0 rgba(255, 255, 255, 0.3);
    font-size: 1.8rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes voicePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(212, 175, 55, 0.5), 
                    inset 0 2px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 32px rgba(212, 175, 55, 0.7), 
                    inset 0 2px 0 rgba(255, 255, 255, 0.4),
                    0 0 0 8px rgba(212, 175, 55, 0.2);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(212, 175, 55, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

.voice-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: center;
    font-weight: 600;
    max-width: 250px;
    line-height: 1.4;
}

.chat-input-wrapper {
    position: relative;
}

/* Loading Animation */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

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

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

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

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

/* App Hidden State */
.app-hidden {
    display: none !important;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: var(--background);
    border: var(--glass-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-profile:hover {
    background: var(--primary-light);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold-shine);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-bg);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.75rem;
    color: #fef5e7;
}

.light-mode .user-name {
    color: #3d2f1f !important;
    font-weight: 700;
}

.pure-light-mode .user-name {
    color: #2d2d2d !important;
    font-weight: 700;
}

.user-email {
    font-size: 0.6rem;
    color: #e8dcc8;
}

.light-mode .user-email {
    color: #3d2f1f !important;
    font-weight: 600;
}

.pure-light-mode .user-email {
    color: #5a5a5a !important;
    font-weight: 600;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: var(--error);
    color: white;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: var(--glass-border);
    margin-top: auto;
    position: relative;
    border-bottom: none;
    border-left: none;
    border-right: none;
}

.profile-menu {
    position: absolute;
    bottom: 100%;
    left: 1rem;
    right: 1rem;
    background: var(--surface);
    border: var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.profile-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
}

.profile-menu-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.profile-menu-item i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
}

.profile-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.mobile-menu-btn {
    background: var(--background);
    border: var(--glass-border);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold-shine);
    color: var(--dark-bg);
    padding: 12px 24px;
    border-radius: 12px;
    z-index: 10002;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    animation: toastIn 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
    white-space: nowrap;
    max-width: 90vw;
    text-align: center;
    transition: opacity 0.3s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        bottom: 0;
    }
    to {
        opacity: 1;
        bottom: 30px;
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        bottom: 30px;
    }
    to {
        opacity: 0;
        bottom: 0;
    }
}

/* Particle Canvas Background */
.particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Advanced AI Features */
.sentiment-analysis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.sentiment-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: var(--glass-border);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.sentiment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--success), var(--warning), var(--error));
}

.sentiment-score {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.sentiment-positive { color: var(--success); }
.sentiment-neutral { color: var(--warning); }
.sentiment-negative { color: var(--error); }

.sentiment-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.news-integration {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.news-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.8rem;
}

.news-sentiment {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pattern-recognition {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1rem 0;
    border: var(--glass-border);
    backdrop-filter: blur(20px);
}

.pattern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.pattern-accuracy {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--background);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: var(--glass-border);
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.pattern-item {
    background: var(--background);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    border: var(--glass-border);
    transition: all 0.3s ease;
    position: relative;
}

.pattern-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

.pattern-confidence {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.pattern-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.pattern-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--primary));
    border-radius: 3px;
    transition: width 1s ease;
}

.ml-visualization {
    margin-top: 1rem;
    height: 200px;
    background: var(--background);
    border-radius: 12px;
    border: var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.predictive-analytics {
    background: var(--gold-shine);
    color: var(--dark-bg);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

.predictive-analytics::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: aiPulse 4s ease-in-out infinite;
}

.confidence-interval {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    position: relative;
    z-index: 1;
}

.confidence-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: white;
    border-radius: 4px;
    transition: width 1s ease;
    position: relative;
}

.confidence-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 4px;
    height: 12px;
    background: white;
    border-radius: 2px;
}

.prediction-range {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

.multi-timeframe {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.timeframe-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1rem;
    border: var(--glass-border);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

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

.timeframe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.timeframe-sync {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sync-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: aiPulse 2s infinite;
}

.timeframe-chart {
    height: 120px;
    border-radius: 8px;
    background: var(--background);
    border: var(--glass-border);
    position: relative;
}

.timeframe-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.risk-management {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1rem 0;
    border: var(--glass-border);
    backdrop-filter: blur(20px);
}

.risk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.risk-score {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--success);
}

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

.optimization-card {
    background: var(--background);
    border-radius: 12px;
    padding: 1rem;
    border: var(--glass-border);
    text-align: center;
    transition: all 0.3s ease;
}

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

.optimization-value {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.optimization-trend {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.ai-insights {
    background: var(--gold-shine);
    color: var(--dark-bg);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

.ai-insights::before {
    content: '🤖';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    opacity: 0.3;
}

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

.insight-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.insight-value {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.insight-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

@keyframes aiPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Quick Action Buttons */
.quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-btn {
    background: var(--surface);
    border: var(--glass-border);
    backdrop-filter: blur(20px);
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow);
}

.quick-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: var(--primary);
    color: white;
}

.quick-btn:active {
    transform: translateY(0);
}

.quick-btn i {
    font-size: 1rem;
}

/* Advanced Micro-Interactions */
.micro-interaction {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 102, 255, 0.15);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(0, 102, 255, 0.3);
}

.click-ripple {
    position: relative;
    overflow: hidden;
}

.click-ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.click-ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, transparent 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-card {
    height: 120px;
    border-radius: 12px;
    margin-bottom: 1rem;
}

/* Premium Typography */
.premium-text {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.gradient-text {
    background: var(--gold-shine);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 3D Elements */
.three-d-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.three-d-card:hover {
    transform: rotateX(5deg) rotateY(5deg) translateZ(20px);
}

/* Gesture Controls */
.gesture-area {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        width: var(--sidebar-width);
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        width: 100%;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
        --header-height: 60px;
    }

    .header {
        padding: 0 1rem;
    }
    
    .header-title {
        font-size: 1rem;
    }
    
    .header-subtitle {
        display: none;
    }

    .chat-messages {
        padding: 0.625rem;
        gap: 0.5rem;
    }
    
    .message {
        max-width: 92%;
        gap: 0.375rem;
    }
    
    .message-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
    }
    
    .message-content {
        padding: 0.4rem 0.625rem;
        font-size: 0.75rem;
    }
    
    .message-content p,
    .message-content li {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .message {
        max-width: 95%;
    }
    
    .message-actions {
        opacity: 1;
        transform: translateY(0);
    }
    
    .action-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .message-content {
        padding: 0.75rem 1rem;
    }

    .market-overview {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .market-card {
        padding: 1rem;
    }

    .analysis-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .metric-card {
        padding: 0.75rem;
    }
    
    .profile-container {
        padding: 1.5rem;
        max-width: 100%;
        width: 100%;
        margin: 0;
    }

    .otp-input-group {
        gap: 0.5rem;
        justify-content: space-between;
    }

    .otp-input {
        width: calc((100% - 2.5rem) / 6);
        height: 45px;
        font-size: 1rem;
    }
    
    .mfa-methods {
        gap: 0.75rem;
    }
    
    .mfa-method {
        padding: 0.75rem;
    }
    
    .chat-input-container {
        padding: 0.5rem 0.75rem;
    }
    
    .quick-chips {
        gap: 0.4rem;
        margin-bottom: 0.6rem;
    }
    
    .chip {
        padding: 0.45rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .chip i {
        font-size: 0.8rem;
    }
    
    .chat-input-wrapper {
        padding: 0.375rem 0.5rem;
        gap: 0.35rem;
        border-radius: 14px;
    }
    
    .input-action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
    
    .send-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .chat-input {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .profile-modal {
        padding: 0.5rem;
    }

    .profile-container {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .profile-logo {
        width: 45px;
        height: 45px;
    }
    
    .profile-title {
        font-size: 1.125rem;
    }
    
    .profile-logo {
        width: 36px;
        height: 36px;
        font-size: 1.125rem;
    }
    
    .otp-input {
        width: calc((100% - 2rem) / 6);
        height: 40px;
        font-size: 0.9rem;
    }
    
    .market-overview {
        gap: 0.5rem;
    }
    
    .analysis-metrics {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .cookie-consent {
        padding: 1rem !important;
    }

    .cookie-content {
        flex-direction: column;
    }

    .cookie-checkboxes {
        flex-direction: column;
        gap: 0.75rem !important;
    }

    .cookie-actions {
        flex-direction: column;
        width: 100%;
    }

    .cookie-btn {
        width: 100%;
    }
}

/* Profile Settings Modal */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

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

.settings-container {
    background: var(--surface);
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: var(--glass-border);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.settings-modal.active .settings-container {
    transform: scale(1);
}

.settings-sidebar {
    width: 240px;
    background: var(--background);
    border-right: var(--glass-border);
    padding: 1.5rem 0;
    overflow-y: auto;
}

.settings-tab {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.settings-tab:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.settings-tab.active {
    background: var(--primary-light);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.settings-tab i {
    width: 20px;
    text-align: center;
}

.settings-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.settings-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.settings-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.settings-close:hover {
    background: var(--error);
    color: white;
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-field {
    margin-bottom: 1.5rem;
}

.settings-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.settings-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: all 0.3s ease;
    outline: none;
}

.settings-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.settings-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-photo-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.profile-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gold-shine);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--dark-bg);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: -webkit-optimize-contrast;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.profile-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.6);
}

.profile-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-photo:hover::after {
    opacity: 1;
    content: '\f002';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: white;
    font-size: 1.5rem;
}

.photo-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.photo-preview-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
}

.photo-preview-img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.photo-preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: var(--error);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.photo-preview-close:hover {
    transform: scale(1.1);
}

.profile-photo-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    background: var(--gold-shine);
    color: var(--dark-bg);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.6);
}

.btn-danger {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 2px solid var(--error);
    background: transparent;
    color: var(--error);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: var(--error);
    color: white;
}

.settings-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: var(--glass-border);
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--border);
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch.active::after {
    left: 27px;
}

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

.settings-row:last-child {
    border-bottom: none;
}

.settings-row-label {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.settings-row-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .settings-container {
        flex-direction: column;
        max-height: 95vh;
    }

    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: var(--glass-border);
        padding: 1rem 0;
        display: flex;
        overflow-x: auto;
    }

    .settings-tab {
        white-space: nowrap;
        border-right: none;
        border-bottom: 3px solid transparent;
    }

    .settings-tab.active {
        border-right: none;
        border-bottom: 3px solid var(--primary);
    }

    .settings-content {
        padding: 1.5rem;
    }
}

/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    backdrop-filter: blur(30px);
    border-top: 2px solid rgba(212, 175, 55, 0.3);
    padding: 1.5rem;
    z-index: 9999;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.cookie-consent.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 250px;
}

.cookie-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.cookie-checkboxes {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.25rem 0;
}

.cookie-checkbox {
    position: relative;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.cookie-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.cookie-checkbox-custom {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--background);
    transition: all 0.3s ease;
    pointer-events: none;
}

.cookie-checkbox input[type="checkbox"]:checked + .cookie-checkbox-custom {
    background: var(--gold-shine);
    border-color: var(--primary);
}

.cookie-checkbox input[type="checkbox"]:checked + .cookie-checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--dark-bg);
    font-size: 14px;
    font-weight: 700;
}

.cookie-checkbox input[type="checkbox"]:disabled + .cookie-checkbox-custom {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-checkbox-label {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    display: block;
    margin-bottom: 0.15rem;
}

.cookie-info-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
    opacity: 0.9;
}

.cookie-actions {
    display: flex;
    gap: 0.75rem;
}

.cookie-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: var(--gold-shine);
    color: var(--dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.6);
}

.cookie-btn-decline {
    background: var(--background);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.cookie-btn-decline:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

/* AI Disclaimer */
.ai-disclaimer {
    text-align: center;
    font-size: 0.68rem;
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    opacity: 0.75;
    line-height: 1.3;
    background: rgba(26, 20, 16, 0.3);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ai-disclaimer i {
    font-size: 0.7rem;
    color: var(--primary);
    flex-shrink: 0;
    opacity: 0.8;
}

.light-mode .ai-disclaimer {
    color: #5a4a38;
    opacity: 0.85;
    background: rgba(245, 238, 225, 0.4);
}

@media (max-width: 768px) {
    .ai-disclaimer {
        font-size: 0.65rem;
        padding: 0.4rem 0.75rem;
    }
}


/* ============================================
   ERROR HANDLER ANIMATIONS
   ============================================ */

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Error notification styles */
.error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--error);
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 999999;
    max-width: 350px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

.error-notification.warning {
    background: var(--warning);
    color: var(--dark-bg);
}

.error-notification.info {
    background: var(--primary);
    color: var(--dark-bg);
}

.error-notification.success {
    background: var(--success);
    color: white;
}

/* Critical error page styles */
.critical-error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark-bg) 0%, #2a1f1a 100%);
    color: var(--text-primary);
    padding: 20px;
    text-align: center;
}

.critical-error-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: shake 0.5s ease;
}

.critical-error-title {
    font-size: 32px;
    margin-bottom: 16px;
    color: var(--primary);
}

.critical-error-message {
    font-size: 16px;
    margin-bottom: 32px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.critical-error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.critical-error-btn {
    background: var(--primary);
    color: var(--dark-bg);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.critical-error-btn:hover {
    transform: scale(1.05);
}

.critical-error-btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .error-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .critical-error-icon {
        font-size: 48px;
    }
    
    .critical-error-title {
        font-size: 24px;
    }
    
    .critical-error-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .critical-error-btn {
        width: 100%;
    }
}


/* ============================================
   OFFLINE MODE INDICATOR
   ============================================ */

.offline-indicator {
    position: fixed;
    top: 70px;
    right: 20px;
    background: rgba(196, 30, 58, 0.95);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: slideInRight 0.3s ease;
}

.offline-indicator i {
    font-size: 16px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Offline mode body styles */
body.offline-mode {
    filter: grayscale(0.1);
}

body.offline-mode::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(196, 30, 58, 0.8) 0%, 
        rgba(196, 30, 58, 0.4) 50%, 
        rgba(196, 30, 58, 0.8) 100%
    );
    background-size: 200% 100%;
    animation: offlinePulse 2s ease-in-out infinite;
    z-index: 99999;
}

@keyframes offlinePulse {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 0%; }
}

/* Online mode - hide indicator */
body.online-mode .offline-indicator {
    display: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .offline-indicator {
        top: 60px;
        right: 10px;
        left: 10px;
        justify-content: center;
        font-size: 13px;
    }
}

/* Light mode adjustments */
.light-mode .offline-indicator {
    background: rgba(196, 30, 58, 0.9);
}


/* ============================================
   TEST OFFLINE BUTTON (Development Only)
   ============================================ */

.test-offline-btn {
    display: none !important; /* Hidden by default */
}

/* Show on localhost only */
body.localhost .test-offline-btn {
    display: inline-flex !important;
}

/* Active state when offline */
.test-offline-btn.offline {
    background: rgba(196, 30, 58, 0.2);
    color: var(--error);
}

.test-offline-btn.offline:hover {
    background: rgba(196, 30, 58, 0.3);
}


/* ============================================
   RATE LIMITING UI FEEDBACK
   ============================================ */

/* Rate limited button state */
button.rate-limited {
    background: rgba(196, 30, 58, 0.8) !important;
    color: white !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    position: relative;
    overflow: hidden;
}

button.rate-limited:hover {
    background: rgba(196, 30, 58, 0.8) !important;
    transform: none !important;
}

button.rate-limited::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: rateLimitShimmer 2s infinite;
}

@keyframes rateLimitShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Rate limit warning toast */
.toast.warning {
    background: rgba(255, 193, 7, 0.95);
    color: var(--dark-bg);
    border-left: 4px solid #ffc107;
}

/* Light mode adjustments */
.light-mode button.rate-limited {
    background: rgba(196, 30, 58, 0.9) !important;
}

.light-mode .toast.warning {
    background: rgba(255, 193, 7, 0.9);
    color: var(--dark-bg);
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
    button.rate-limited::before {
        animation: none;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    button.rate-limited {
        font-size: 14px;
        padding: 12px 20px;
    }
}


/* Beautiful Notification Styles */
.beautiful-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    min-width: 320px;
    max-width: 420px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10000;
    overflow: hidden;
}

.beautiful-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notif-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
}

.notif-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    animation: iconBounce 0.6s ease-out;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.notif-text {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.notif-message {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.notif-action {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.notif-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.notif-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.notif-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.beautiful-notification.success_with_warning {
    background: linear-gradient(135deg, #f0fdf4 0%, #fef3c7 100%);
    border-left: 4px solid #10b981;
}

.beautiful-notification.success_with_warning .notif-title {
    background: linear-gradient(135deg, #10b981 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .beautiful-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
}
