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

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(ellipse at top, #0a0f1a, #030613);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    transition: background 1s ease;
}

/* Star background - deep space */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: transparent url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMiIgaGVpZ2h0PSIyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxjaXJjbGUgY3g9IjEiIGN5PSIxIiByPSIxIiBmaWxsPSJ3aGl0ZSIvPjwvc3ZnPg==') repeat;
    opacity: 0.8;
    animation: starsMove 200s linear infinite;
}

.twinkling {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: transparent url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNCIgaGVpZ2h0PSI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxjaXJjbGUgY3g9IjIiIGN5PSIyIiByPSIxIiBmaWxsPSJ3aGl0ZSIvPjwvc3ZnPg==') repeat;
    opacity: 0.4;
    animation: twinkle 4s ease-in-out infinite;
}

@keyframes starsMove {
    from { transform: translateY(0); }
    to { transform: translateY(-1000px); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* Main container */
.app-container {
    display: flex;
    max-width: 1600px;
    margin: 20px auto;
    background: rgba(10, 15, 25, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    min-height: 90vh;
    position: relative;
    z-index: 10;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   JARVIS MODE - STARK INDUSTRIES
   ============================================ */
.jarvis-mode-active {
    --jarvis-blue: #00aaff;
    --jarvis-cyan: #00ffff;
    --jarvis-glow: 0 0 60px rgba(0, 170, 255, 0.9);
    --jarvis-glow-strong: 0 0 100px rgba(0, 170, 255, 1);
    --jarvis-scan: rgba(0, 170, 255, 0.2);
    --jarvis-grid: rgba(0, 170, 255, 0.15);
}

.jarvis-mode-active body {
    background: radial-gradient(ellipse at 30% 40%, #0a1a3a, #01020a);
}

.jarvis-mode-active .app-container {
    background: rgba(5, 12, 25, 0.95);
    border-color: var(--jarvis-blue);
    box-shadow: 0 0 100px rgba(0, 170, 255, 0.8), inset 0 0 50px rgba(0, 170, 255, 0.4);
    backdrop-filter: blur(30px);
    animation: containerPulse 4s ease-in-out infinite;
}

@keyframes containerPulse {
    0%, 100% { box-shadow: 0 0 100px rgba(0, 170, 255, 0.8), inset 0 0 50px rgba(0, 170, 255, 0.4); }
    50% { box-shadow: 0 0 150px rgba(0, 170, 255, 1), inset 0 0 80px rgba(0, 170, 255, 0.6); }
}

/* ============================================
   LEFT SIDEBAR
   ============================================ */
.sidebar {
    width: 300px;
    background: rgba(10, 5, 20, 0.8);
    backdrop-filter: blur(10px);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(139, 92, 246, 0.3);
    transition: all 0.5s ease;
    overflow-y: auto;
    max-height: 90vh;
}

.wizard-profile {
    text-align: center;
    margin-bottom: 30px;
}

.wizard-avatar {
    font-size: 64px;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
}

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

.wizard-profile h1 {
    color: #fff;
    font-size: 24px;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #c4b5fd, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    color: #a78bfa;
    font-size: 14px;
    margin-bottom: 15px;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 30px;
    border: 1px solid #8b5cf6;
    color: #fff;
    font-size: 12px;
    transition: all 0.5s ease;
}

.jarvis-mode-active .status-badge {
    border-color: #00aaff;
    background: rgba(0, 170, 255, 0.2);
    box-shadow: 0 0 30px rgba(0, 170, 255, 0.4);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: #ef4444;
}

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

/* User Section */
.user-section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    border: 1px solid #8b5cf6;
}

.jarvis-mode-active .user-section {
    background: rgba(0, 170, 255, 0.1);
    border-color: #00aaff;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.user-email {
    color: #c4b5fd;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jarvis-mode-active .user-email {
    color: #00aaff;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #ef4444;
    color: white;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-btn {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.login-btn {
    background: #8b5cf6;
    color: white;
}

.login-btn:hover {
    background: #6d28d9;
}

.jarvis-mode-active .login-btn {
    background: #00aaff;
}

.signup-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #8b5cf6;
    color: white;
}

.signup-btn:hover {
    background: rgba(139, 92, 246, 0.3);
}

.jarvis-mode-active .signup-btn {
    border-color: #00aaff;
}

/* Mode selector */
.mode-selector {
    margin-bottom: 20px;
}

.mode-selector h2 {
    color: #c4b5fd;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.jarvis-mode-active .mode-selector h2 {
    color: #00aaff;
}

.custom-dropdown {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
}

.custom-dropdown-btn {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jarvis-mode-active .custom-dropdown-btn {
    border-color: #00aaff;
    background: rgba(0, 170, 255, 0.1);
    box-shadow: 0 0 30px rgba(0, 170, 255, 0.2);
}

.custom-dropdown-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
}

.jarvis-mode-active .custom-dropdown-btn:hover {
    background: rgba(0, 170, 255, 0.2);
    border-color: #00aaff;
}

.dropdown-arrow {
    color: #8b5cf6;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.jarvis-mode-active .dropdown-arrow {
    color: #00aaff;
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a0f33;
    border: 1px solid #8b5cf6;
    border-radius: 12px;
    margin-top: 5px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.jarvis-mode-active .custom-dropdown-content {
    background: #0a1a2a;
    border-color: #00aaff;
}

.custom-dropdown.open .custom-dropdown-content {
    display: block;
}

.dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    color: #fff;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(139, 92, 246, 0.2);
}

.jarvis-mode-active .dropdown-item:hover {
    background: rgba(0, 170, 255, 0.2);
}

.dropdown-item.selected {
    background: rgba(139, 92, 246, 0.3);
    border-left: 3px solid #8b5cf6;
}

.jarvis-mode-active .dropdown-item.selected {
    background: rgba(0, 170, 255, 0.3);
    border-left: 3px solid #00aaff;
}

/* Stats Dashboard v8.0 */
.stats-dashboard {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 3px solid #8b5cf6;
}

.stats-dashboard h3 {
    color: #c4b5fd;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.jarvis-mode-active .stats-dashboard h3 {
    color: #00aaff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.stat-card:hover {
    transform: translateY(-2px);
    background: rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
}

.jarvis-mode-active .stat-card:hover {
    background: rgba(0, 170, 255, 0.1);
    border-color: #00aaff;
}

.stat-icon {
    font-size: 20px;
    display: block;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #8b5cf6;
    display: block;
}

.jarvis-mode-active .stat-value {
    color: #00aaff;
}

.stat-label {
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Turbo Container */
.turbo-container {
    margin-bottom: 20px;
}

.turbo-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4b5563, #374151);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.turbo-btn.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
}

.jarvis-mode-active .turbo-btn.active {
    background: linear-gradient(135deg, #00aaff, #0066aa);
    box-shadow: 0 0 30px rgba(0, 170, 255, 0.5);
}

.turbo-icon {
    font-size: 18px;
}

.turbo-status {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    margin-left: 5px;
}

/* Model Status */
.model-status {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

.model-status h2 {
    color: #c4b5fd;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.jarvis-mode-active .model-status h2 {
    color: #00aaff;
}

.model-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 8px;
    border-left: 3px solid #8b5cf6;
}

.jarvis-mode-active .model-info {
    background: rgba(0, 170, 255, 0.1);
    border-left-color: #00aaff;
}

.model-icon {
    font-size: 20px;
}

.model-name {
    color: white;
    font-size: 13px;
    font-weight: 500;
}

/* Reset button */
.reset-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.4);
}

.jarvis-mode-active .reset-button {
    background: linear-gradient(135deg, #00aaff, #0066aa);
    box-shadow: 0 0 40px rgba(0, 170, 255, 0.6);
}

/* Footer */
.footer-note {
    margin-top: auto;
    text-align: center;
}

.footer-note p {
    color: #6b7280;
    font-size: 12px;
}

.version {
    font-size: 14px;
    font-weight: bold;
    color: #8b5cf6;
    margin-top: 4px;
}

.jarvis-mode-active .version {
    color: #00aaff;
}

/* ============================================
   MAIN CHAT AREA
   ============================================ */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(5, 3, 10, 0.6);
    transition: all 0.5s ease;
    position: relative;
}

.chat-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.5s ease;
}

.jarvis-mode-active .chat-header {
    border-bottom-color: #00aaff;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-emoji-large {
    font-size: 24px;
}

.chat-header h2 {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.chat-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.chat-action-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
    transform: scale(1.05);
}

.jarvis-mode-active .chat-action-btn:hover {
    background: rgba(0, 170, 255, 0.2);
    border-color: #00aaff;
}

.chat-action-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

/* Pro Toolbar v8.0 */
.pro-toolbar {
    display: flex;
    gap: 8px;
    padding: 10px 30px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    flex-wrap: wrap;
}

.pro-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    color: white;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.pro-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
    transform: translateY(-1px);
}

.pro-btn.active {
    background: #8b5cf6;
    border-color: white;
}

.jarvis-mode-active .pro-btn.active {
    background: #00aaff;
}

.btn-icon {
    font-size: 16px;
}

.btn-text {
    font-size: 12px;
    font-weight: 500;
}

/* Chat History */
.chat-history {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(90vh - 220px);
}

/* Message bubbles */
.message {
    max-width: 80%;
    animation: slideIn 0.3s ease;
    position: relative;
}

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

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

.message.wizard {
    align-self: flex-start;
}

.message-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.message-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    flex-shrink: 0;
    transition: all 0.5s ease;
}

.jarvis-mode-active .message.wizard .message-icon {
    border-color: #00aaff;
    background: rgba(0, 170, 255, 0.2);
    box-shadow: 0 0 30px rgba(0, 170, 255, 0.4);
}

.message.user .message-icon {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: none;
}

.jarvis-mode-active .message.user .message-icon {
    background: linear-gradient(135deg, #00aaff, #0066aa);
}

.message-text {
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 15px;
    word-break: break-word;
    transition: all 0.5s ease;
}

.message.user .message-text {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: white;
    border-bottom-right-radius: 5px;
}

.jarvis-mode-active .message.user .message-text {
    background: linear-gradient(135deg, #00aaff, #0066aa);
}

.message.wizard .message-text {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #e0e7ff;
    border-bottom-left-radius: 5px;
}

.jarvis-mode-active .message.wizard .message-text {
    border-color: #00aaff;
    background: rgba(0, 170, 255, 0.1);
    box-shadow: 0 0 30px rgba(0, 170, 255, 0.2);
}

.message-time {
    color: #ffffff !important;
    opacity: 0.7;
    font-size: 10px;
    margin-top: 4px;
    display: block;
    text-align: right;
}

.message.thinking .message-icon {
    animation: spin 2s linear infinite;
}

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

/* Typing cursor */
.message.wizard.typing-active .message-text::after {
    content: '|';
    animation: blink 1s infinite;
    margin-left: 2px;
    color: #8b5cf6;
}

.jarvis-mode-active .message.wizard.typing-active .message-text::after {
    color: #00aaff;
}

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

/* Input Area v8.0 */
.input-area {
    padding: 20px 30px;
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    gap: 10px;
    transition: border-color 0.5s ease;
    position: relative;
}

.jarvis-mode-active .input-area {
    border-top-color: #00aaff;
}

#chat-input {
    flex: 1;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 30px;
    color: #fff;
    font-size: 15px;
    transition: all 0.3s ease;
}

#chat-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.jarvis-mode-active #chat-input:focus {
    border-color: #00aaff;
    box-shadow: 0 0 40px rgba(0, 170, 255, 0.5);
}

#chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Voice Button - Works for ALL Modes */
.voice-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

.voice-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
}

.voice-btn.listening {
    animation: voicePulse 1s infinite;
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.jarvis-mode-active .voice-btn {
    background: linear-gradient(135deg, #00aaff, #0066aa);
    box-shadow: 0 0 30px rgba(0, 170, 255, 0.6);
}

@keyframes voicePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px #ef4444; }
    50% { transform: scale(1.1); box-shadow: 0 0 50px #ef4444; }
}

.send-button {
    padding: 0 25px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.4);
}

.jarvis-mode-active .send-button {
    background: linear-gradient(135deg, #00aaff, #0066aa);
    box-shadow: 0 0 40px rgba(0, 170, 255, 0.6);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-button.loading {
    position: relative;
    overflow: hidden;
}

.send-button.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    from { left: -100%; }
    to { left: 100%; }
}

/* Upload Progress Bar v8.0 */
.upload-progress {
    position: absolute;
    bottom: 100px;
    left: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #8b5cf6;
    backdrop-filter: blur(10px);
    z-index: 100;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #c4b5fd);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    color: white;
    font-size: 12px;
    display: block;
    text-align: center;
}

/* ============================================
   RIGHT SIDEBAR - CHATS
   ============================================ */
.chats-sidebar {
    width: 280px;
    background: rgba(5, 3, 15, 0.8);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(139, 92, 246, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.5s ease;
}

.jarvis-mode-active .chats-sidebar {
    border-left-color: #00aaff;
}

.chats-header {
    padding: 20px 15px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.jarvis-mode-active .chats-header {
    border-bottom-color: #00aaff;
}

.chats-header h2 {
    color: #c4b5fd;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.jarvis-mode-active .chats-header h2 {
    color: #00aaff;
}

.new-chat-btn {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid #8b5cf6;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.new-chat-btn:hover {
    background: #8b5cf6;
    transform: scale(1.05);
}

.jarvis-mode-active .new-chat-btn {
    border-color: #00aaff;
    background: rgba(0, 170, 255, 0.2);
}

.jarvis-mode-active .new-chat-btn:hover {
    background: #00aaff;
}

.chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chat-item {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
}

.chat-item:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.jarvis-mode-active .chat-item:hover {
    background: rgba(0, 170, 255, 0.15);
    border-color: #00aaff;
}

.chat-item.active {
    background: rgba(139, 92, 246, 0.25);
    border-left: 3px solid #8b5cf6;
}

.jarvis-mode-active .chat-item.active {
    background: rgba(0, 170, 255, 0.25);
    border-left-color: #00aaff;
}

.chat-emoji {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.chat-name {
    flex: 1;
    color: white;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-actions {
    display: none;
    gap: 4px;
    margin-right: 4px;
}

.chat-item:hover .chat-item-actions {
    display: flex;
}

.rename-chat-item, .delete-chat-item {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.rename-chat-item:hover {
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.2);
}

.jarvis-mode-active .rename-chat-item:hover {
    color: #00aaff;
    background: rgba(0, 170, 255, 0.2);
}

.delete-chat-item:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
}

/* Quick Stats Mini */
.quick-stats {
    padding: 15px;
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

.quick-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 12px;
}

.quick-stat-icon {
    font-size: 14px;
    width: 20px;
}

.quick-stat-label {
    color: #9ca3af;
}

.quick-stat-value {
    color: #8b5cf6;
    font-weight: 600;
    margin-left: auto;
}

.jarvis-mode-active .quick-stat-value {
    color: #00aaff;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #1a0f33;
    border: 2px solid #8b5cf6;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.jarvis-mode-active .modal-content {
    border-color: #00aaff;
    background: #0a1a2a;
}

.auth-modal {
    max-width: 380px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #c4b5fd;
    font-size: 20px;
    margin: 0;
}

.jarvis-mode-active .modal-header h3 {
    color: #00aaff;
}

.close-modal {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.close-modal:hover {
    color: white;
}

/* Pro Modals */
.pro-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pro-modal-content {
    background: #1a0f33;
    border: 2px solid #8b5cf6;
    border-radius: 24px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(139, 92, 246, 0.3);
}

.pro-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pro-modal-header h3 {
    color: #c4b5fd;
    font-size: 20px;
    margin: 0;
}

.close-pro-modal {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.close-pro-modal:hover {
    color: white;
}

.pro-modal-body {
    padding: 30px;
}

/* Image Size Selector v8.0 */
.image-size-selector {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.image-size-selector label {
    color: #c4b5fd;
    font-size: 14px;
}

.image-size-selector select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #8b5cf6;
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
}

.image-size-selector select:focus {
    outline: none;
    border-color: #c4b5fd;
}

/* Stats Detailed Modal v8.0 */
.stats-detailed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    border-left: 3px solid #8b5cf6;
}

.stats-section h4 {
    color: #c4b5fd;
    font-size: 14px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

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

.stats-row span:first-child {
    color: #9ca3af;
    font-size: 13px;
}

.stats-row span:last-child {
    color: #8b5cf6;
    font-weight: 600;
    font-size: 14px;
}

/* Notification Toast v8.0 */
.notification-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(26, 15, 51, 0.95);
    border: 1px solid #8b5cf6;
    border-radius: 30px;
    padding: 12px 24px;
    color: white;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1000000;
    transition: transform 0.3s ease;
    text-align: center;
}

.notification-toast.show {
    transform: translateX(-50%) translateY(0);
}

.notification-toast.success {
    border-color: #10b981;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.notification-toast.error {
    border-color: #ef4444;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

/* Form Elements */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: #c4b5fd;
    font-size: 13px;
    margin-bottom: 5px;
}

.jarvis-mode-active .form-group label {
    color: #00aaff;
}

.form-group input, 
.form-group select,
.pro-input,
#code-input {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 14px;
}

.form-group input:focus,
.pro-input:focus,
#code-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

.resend-btn {
    margin-top: 10px;
    background: none;
    border: 1px solid #8b5cf6;
    color: white;
    padding: 8px;
    border-radius: 6px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.resend-btn:hover {
    background: rgba(139, 92, 246, 0.2);
}

.auth-error {
    color: #ef4444;
    font-size: 12px;
    margin-bottom: 15px;
    min-height: 20px;
}

.auth-submit {
    width: 100%;
    padding: 12px;
    background: #8b5cf6;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 15px;
}

.auth-submit:hover {
    background: #6d28d9;
}

.auth-switch {
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

.auth-switch button {
    background: none;
    border: none;
    color: #8b5cf6;
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
    margin-left: 5px;
}

.auth-switch button:hover {
    color: #c4b5fd;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.modal-buttons button:first-child {
    background: #8b5cf6;
    color: white;
}

.modal-buttons button:last-child {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-buttons button:hover {
    transform: translateY(-2px);
}

/* Memory List */
.memory-list {
    max-height: 400px;
    overflow-y: auto;
}

.memory-item {
    background: rgba(139, 92, 246, 0.1);
    border-left: 3px solid #8b5cf6;
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
}

.memory-key {
    font-weight: bold;
    color: #c4b5fd;
    margin-bottom: 4px;
}

.memory-value {
    color: #e0e7ff;
    font-size: 14px;
    margin-bottom: 4px;
}

.memory-category {
    display: inline-block;
    background: #8b5cf6;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    margin-top: 4px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a0f33;
}

::-webkit-scrollbar-thumb {
    background: #8b5cf6;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6d28d9;
}

.jarvis-mode-active ::-webkit-scrollbar-thumb {
    background: #00aaff;
}

/* Responsive */
@media (max-width: 1200px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar, .chats-sidebar {
        width: 100%;
        max-height: none;
    }
    
    .chats-sidebar {
        border-left: none;
        border-top: 1px solid rgba(139, 92, 246, 0.3);
    }
    
    .message {
        max-width: 90%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pro-toolbar {
        justify-content: center;
    }
    
    .pro-btn .btn-text {
        display: none;
    }
    
    .pro-btn {
        padding: 8px;
    }
    
    .btn-icon {
        font-size: 20px;
        margin: 0;
    }
}
