/* ============================================
   SMIS FORGE - Premium Dark Theme
   Hollywood-Quality AI Interface
   ============================================ */

/* CSS Variables */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-glass: rgba(18, 18, 26, 0.7);
    --bg-glass-hover: rgba(26, 26, 36, 0.8);

    --accent-primary: #00d4ff;
    --accent-secondary: #0066ff;
    --accent-gold: #ffd700;
    --accent-glow: rgba(0, 212, 255, 0.3);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.4);

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-active: rgba(0, 212, 255, 0.3);

    --success: #00ff88;
    --warning: #ffaa00;
    --error: #ff4466;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;

    /* Shadows */
    --shadow-glow: 0 0 40px rgba(0, 212, 255, 0.15);
    --shadow-deep: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Particle Canvas */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Ambient Glow Effects */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

.glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: glowFloat 15s ease-in-out infinite;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation: glowFloat 20s ease-in-out infinite reverse;
}

.glow-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: glowPulse 8s ease-in-out infinite;
    opacity: 0.2;
}

@keyframes glowFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.15; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.25; transform: translate(-50%, -50%) scale(1.2); }
}

/* Glass Panel Effect */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

/* Screen States */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 1;
}

.screen.active {
    display: flex;
}

/* ============================================
   LOGIN SCREEN
   ============================================ */

#login-screen {
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 3rem;
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

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

.logo-section {
    margin-bottom: 2.5rem;
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.logo-svg {
    width: 100%;
    height: 100%;
}

.logo-ring {
    animation: logoSpin 20s linear infinite;
    transform-origin: center;
}

.logo-ring-inner {
    animation: logoSpin 15s linear infinite reverse;
    transform-origin: center;
}

.logo-core {
    animation: logoPulse 3s ease-in-out infinite;
}

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

@keyframes logoPulse {
    0%, 100% { opacity: 1; r: 8; }
    50% { opacity: 0.7; r: 10; }
}

.logo-text {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}

.accent {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.login-form {
    margin-bottom: 2rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-normal);
    text-align: center;
    letter-spacing: 0.1em;
}

.input-group input::placeholder {
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
}

.input-group input:focus {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.05);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.1);
}

.input-glow {
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    z-index: -1;
    filter: blur(10px);
    transition: opacity var(--transition-normal);
}

.input-group input:focus ~ .input-glow {
    opacity: 0.3;
}

.btn-primary {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bg-primary);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

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

.btn-primary.loading .btn-text {
    opacity: 0;
}

.btn-primary.loading .btn-loader {
    opacity: 1;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px solid transparent;
    border-top-color: var(--bg-primary);
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(0, 255, 136, 0); }
}

/* ============================================
   MAIN APPLICATION
   ============================================ */

#app-screen {
    flex-direction: column;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 100;
}

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

.logo-mini {
    width: 40px;
    height: 40px;
}

.logo-svg-mini .logo-ring {
    animation: logoSpin 20s linear infinite;
    transform-origin: 20px 20px;
}

.logo-svg-mini .logo-core {
    animation: logoPulse 3s ease-in-out infinite;
}

.header-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 100px;
    position: relative;
}

.pulse-ring {
    position: absolute;
    left: 1rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.6); }
    100% { box-shadow: 0 0 0 15px rgba(0, 255, 136, 0); }
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
}

.status-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--success);
    letter-spacing: 0.05em;
}

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

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* Main Content Layout */
.app-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border-right: 1px solid var(--border-subtle);
    border-top: none;
    border-bottom: none;
    border-left: none;
    overflow-y: auto;
    transition: transform var(--transition-normal), width var(--transition-normal);
}

.sidebar.collapsed {
    transform: translateX(-100%);
    width: 0;
}

.sidebar-section {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.sidebar-title svg {
    width: 16px;
    height: 16px;
    opacity: 0.5;
}

.session-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.session-item {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.session-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-subtle);
}

.session-item.active {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--accent-primary);
}

.session-item h4 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-item span {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.empty-state {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-tertiary);
}

.empty-state p {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.empty-state span {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.05);
}

.upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.1);
    box-shadow: inset 0 0 30px rgba(0, 212, 255, 0.1);
}

.upload-zone.dragover::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0.2;
    animation: borderGlow 1s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.4; }
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 0.75rem;
    color: var(--text-tertiary);
    transition: color var(--transition-normal);
}

.upload-zone:hover .upload-icon {
    color: var(--accent-primary);
}

.upload-zone p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.upload-zone span {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

#file-input {
    display: none;
}

.uploaded-files {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.uploaded-file {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 212, 255, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.uploaded-file svg {
    width: 14px;
    height: 14px;
    color: var(--accent-primary);
}

.uploaded-file span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Module Drafts */
.module-drafts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.module-draft {
    padding: 0.75rem;
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: var(--radius-sm);
}

.module-draft h4 {
    font-size: 0.875rem;
    color: var(--accent-gold);
    margin-bottom: 0.25rem;
}

.module-draft span {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

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

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages */
.message {
    display: flex;
    gap: 1rem;
    max-width: 85%;
    animation: messageIn 0.4s ease;
}

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

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

.message-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
}

.avatar-svg {
    width: 100%;
    height: 100%;
}

.message.adam .message-avatar {
    background: linear-gradient(135deg, var(--accent-gold), #ff8800);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.message-author {
    font-weight: 600;
    font-size: 0.875rem;
}

.message.smis .message-author {
    color: var(--accent-primary);
}

.message.adam .message-author {
    color: var(--accent-gold);
}

.message-badge {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-primary);
    border-radius: 100px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.message-body {
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.message.smis .message-body {
    border-left: 3px solid var(--accent-primary);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.05);
}

.message.adam .message-body {
    background: rgba(255, 215, 0, 0.08);
    border-left: none;
    border-right: 3px solid var(--accent-gold);
}

.message-body p {
    margin-bottom: 0.75rem;
}

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

.message-body code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    padding: 0.2em 0.4em;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    color: var(--accent-primary);
}

.message-body pre {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
}

.message-body pre code {
    padding: 0;
    background: none;
    font-size: 0.8rem;
    line-height: 1.5;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 1rem;
    padding: 0 2rem;
    margin-bottom: 1rem;
}

.typing-indicator.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.typing-avatar {
    width: 44px;
    height: 44px;
}

.typing-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.typing-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Chat Input */
.chat-input-container {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin: 0 2rem 2rem;
    padding: 1rem;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.1);
}

.input-wrapper textarea {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: none;
    max-height: 150px;
}

.input-wrapper textarea::placeholder {
    color: var(--text-tertiary);
}

.input-actions {
    display: flex;
    gap: 0.25rem;
}

.input-action {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
}

.input-action svg {
    width: 18px;
    height: 18px;
}

.btn-send {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--bg-primary);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

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

.btn-send svg {
    width: 18px;
    height: 18px;
}

/* Processing Overlay */
.processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.processing-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.processing-content {
    padding: 3rem;
    text-align: center;
    max-width: 400px;
}

.processing-animation {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    position: relative;
}

.processing-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--accent-primary);
    animation: processingRotate 1.5s linear infinite;
}

.processing-ring:nth-child(2) {
    inset: 10px;
    border-top-color: var(--accent-secondary);
    animation-duration: 2s;
    animation-direction: reverse;
}

.processing-ring:nth-child(3) {
    inset: 20px;
    border-top-color: var(--accent-gold);
    animation-duration: 2.5s;
}

.processing-core {
    position: absolute;
    inset: 35px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    animation: processingPulse 2s ease-in-out infinite;
}

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

@keyframes processingPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.8); opacity: 0.7; }
}

.processing-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.processing-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.processing-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        position: absolute;
        left: 0;
        top: 60px;
        bottom: 0;
        z-index: 50;
        border-radius: 0;
    }

    .header-center {
        display: none;
    }
}

@media (max-width: 768px) {
    .chat-input-container {
        margin: 0 1rem 1rem;
        flex-direction: column;
    }

    .btn-send {
        width: 100%;
        justify-content: center;
    }

    .chat-messages {
        padding: 1rem;
    }

    .message {
        max-width: 95%;
    }
}

/* ============================================
   MODAL STYLES
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    margin: 1rem;
}

.modal-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-content form {
    margin-top: 1.5rem;
}

.error-message {
    padding: 0.75rem 1rem;
    background: rgba(255, 68, 102, 0.15);
    border: 1px solid rgba(255, 68, 102, 0.3);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* ============================================
   ADMIN PANEL STYLES
   ============================================ */

.admin-panel {
    width: 400px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    animation: slideInRight 0.3s ease;
    max-height: calc(100vh - 60px);
}

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

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 68, 102, 0.05);
}

.admin-header h2 {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--error);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-header h2::before {
    content: '⚡';
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.stat-card {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card:nth-child(1) .stat-value { color: var(--warning); }
.stat-card:nth-child(2) .stat-value { color: var(--success); }
.stat-card:nth-child(3) .stat-value { color: var(--error); }
.stat-card:nth-child(4) .stat-value { color: var(--accent-primary); }

.stat-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-filters {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.filter-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--text-tertiary);
}

.filter-btn.active {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.admin-submissions {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.submission-card {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.submission-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--text-tertiary);
}

.submission-card.status-pending {
    border-left: 3px solid var(--warning);
}

.submission-card.status-approve {
    border-left: 3px solid var(--success);
}

.submission-card.status-reject {
    border-left: 3px solid var(--error);
}

.submission-card.status-flag {
    border-left: 3px solid var(--accent-gold);
}

.submission-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.submission-type {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-primary);
    border-radius: 100px;
}

.submission-type.chat {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-primary);
}

.submission-type.file {
    background: rgba(255, 215, 0, 0.15);
    color: var(--accent-gold);
}

.submission-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.submission-content {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.submission-file {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 215, 0, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--accent-gold);
    margin-bottom: 0.75rem;
}

.submission-file svg {
    width: 14px;
    height: 14px;
}

.submission-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn.approve {
    background: rgba(0, 255, 136, 0.15);
    color: var(--success);
}

.action-btn.approve:hover {
    background: rgba(0, 255, 136, 0.25);
}

.action-btn.reject {
    background: rgba(255, 68, 102, 0.15);
    color: var(--error);
}

.action-btn.reject:hover {
    background: rgba(255, 68, 102, 0.25);
}

.action-btn.flag {
    background: rgba(255, 215, 0, 0.15);
    color: var(--accent-gold);
}

.action-btn.flag:hover {
    background: rgba(255, 215, 0, 0.25);
}

.submission-status-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 100px;
    margin-top: 0.5rem;
    display: inline-block;
}

.submission-status-badge.approved {
    background: rgba(0, 255, 136, 0.15);
    color: var(--success);
}

.submission-status-badge.rejected {
    background: rgba(255, 68, 102, 0.15);
    color: var(--error);
}

.submission-status-badge.flagged {
    background: rgba(255, 215, 0, 0.15);
    color: var(--accent-gold);
}

/* Admin panel responsive */
@media (max-width: 1200px) {
    .admin-panel {
        position: fixed;
        right: 0;
        top: 60px;
        bottom: 0;
        z-index: 100;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
    }
}

@media (max-width: 768px) {
    .admin-panel {
        width: 100%;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   CHOICE SCREEN STYLES
   ============================================ */

.choice-container {
    max-width: 600px;
    padding: 40px;
    animation: fadeInUp 0.5s ease;
}

.choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.choice-btn {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    background: rgba(0, 20, 40, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.choice-btn:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    transform: translateX(5px);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
}

.choice-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 12px;
}

.choice-icon svg {
    width: 28px;
    height: 28px;
    stroke: #00d4ff;
}

.choice-text h3 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}

.choice-text p {
    margin: 0;
    color: #888;
    font-size: 0.9rem;
    line-height: 1.4;
}

.choice-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.btn-link {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

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

/* ============================================
   DEV TASKS SCREEN STYLES
   ============================================ */

.dev-tasks-main {
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 80px;
}

.dev-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: rgba(0, 20, 40, 0.4);
    border-radius: 10px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #00d4ff;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.new-task-section {
    padding: 25px;
}

.new-task-section h3 {
    margin: 0 0 20px 0;
    color: #00d4ff;
    font-size: 1.1rem;
}

#new-task-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row input,
.form-row textarea,
.form-row select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 20, 40, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: #00d4ff;
}

.form-row textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.task-list-section {
    padding: 25px;
}

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

.task-list-header h3 {
    margin: 0;
    color: #00d4ff;
}

.task-filters select {
    padding: 8px 12px;
    background: rgba(0, 20, 40, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.task-item {
    padding: 15px;
    background: rgba(0, 20, 40, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.task-item:hover {
    border-color: rgba(0, 212, 255, 0.3);
}

.task-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.task-item-title {
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.task-item-meta {
    display: flex;
    gap: 8px;
}

.task-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.task-badge.priority-critical {
    background: rgba(255, 50, 50, 0.2);
    color: #ff5050;
}

.task-badge.priority-high {
    background: rgba(255, 150, 0, 0.2);
    color: #ff9600;
}

.task-badge.priority-medium {
    background: rgba(0, 150, 255, 0.2);
    color: #0096ff;
}

.task-badge.priority-low {
    background: rgba(100, 100, 100, 0.2);
    color: #888;
}

.task-badge.status-pending {
    background: rgba(255, 200, 0, 0.2);
    color: #ffc800;
}

.task-badge.status-approved {
    background: rgba(0, 200, 150, 0.2);
    color: #00c896;
}

.task-badge.status-in_progress {
    background: rgba(0, 150, 255, 0.2);
    color: #0096ff;
}

.task-badge.status-completed {
    background: rgba(0, 255, 100, 0.2);
    color: #00ff64;
}

.task-badge.status-rejected {
    background: rgba(255, 100, 100, 0.2);
    color: #ff6464;
}

.task-item-description {
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 10px;
}

.task-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #666;
}

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

.task-action-btn {
    padding: 5px 10px;
    border: 1px solid;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.task-action-btn.approve {
    border-color: #00c896;
    color: #00c896;
}

.task-action-btn.approve:hover {
    background: rgba(0, 200, 150, 0.2);
}

.task-action-btn.reject {
    border-color: #ff6464;
    color: #ff6464;
}

.task-action-btn.reject:hover {
    background: rgba(255, 100, 100, 0.2);
}

@media (max-width: 768px) {
    .dev-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row-split {
        grid-template-columns: 1fr;
    }

    .choice-btn {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================
   PRO TRADER DASHBOARD
   ============================================ */

#pro-trader-screen {
    display: none;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-primary);
}

#pro-trader-screen.active {
    display: flex;
}

.pt-main {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Account Stats Bar */
.pt-account-bar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.pt-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border-radius: 12px;
    text-align: center;
}

.pt-stat-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.pt-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Sections */
.pt-section {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 12px;
}

.pt-section-title {
    margin: 0 0 16px 0;
    font-size: 0.95rem;
    color: var(--accent-gold);
    font-weight: 600;
}

/* Positions Table */
.pt-table-wrap {
    overflow-x: auto;
}

.pt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.pt-table thead th {
    text-align: left;
    padding: 8px 12px;
    color: var(--text-tertiary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
}

.pt-table tbody td {
    padding: 10px 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
}

.pt-table tbody tr:hover {
    background: var(--bg-glass-hover);
}

.pt-symbol {
    font-weight: 700;
    color: var(--accent-primary);
}

.pt-side-long {
    background: rgba(0, 255, 136, 0.15);
    color: var(--success);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pt-side-short {
    background: rgba(255, 68, 102, 0.15);
    color: var(--error);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Predictions */
.pt-predictions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
}

.pt-prediction-card {
    padding: 14px 16px;
    border-radius: 10px;
    border-left: 3px solid var(--accent-gold);
}

.pt-pred-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.pt-pred-symbol {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--accent-primary);
}

.pt-dir-buy {
    background: rgba(0, 255, 136, 0.15);
    color: var(--success);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.pt-dir-sell {
    background: rgba(255, 68, 102, 0.15);
    color: var(--error);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.pt-outcome-win {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.pt-outcome-loss {
    background: rgba(255, 68, 102, 0.2);
    color: var(--error);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.pt-outcome-pending {
    background: rgba(255, 170, 0, 0.15);
    color: var(--warning);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.pt-pred-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-left: auto;
}

.pt-pred-levels {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.pt-pred-reasoning {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle);
}

.pt-pred-patterns {
    font-size: 0.7rem;
    color: var(--accent-primary);
    margin-top: 4px;
    opacity: 0.8;
}

.pt-pred-confidence {
    font-size: 0.75rem;
    color: var(--accent-gold);
    margin-top: 4px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .pt-account-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}
