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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0a0a0f;
    color: #e5e5e5;
    overflow-x: hidden;
}

/* Utilities */
.hidden {
    display: none !important;
}

.monospace {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Login Page Styles */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: rgba(30, 30, 45, 0.8);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 40px 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 40px rgba(245, 158, 11, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #f59e0b;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.login-subtitle {
    color: #94a3b8;
    font-size: 14px;
    letter-spacing: 1px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input {
    padding: 12px 16px;
    background: rgba(15, 15, 25, 0.8);
    border: 1px solid rgba(100, 100, 120, 0.3);
    border-radius: 8px;
    color: #e5e5e5;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
    background: rgba(15, 15, 25, 1);
}

.login-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.login-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top: 2px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 12px;
    color: #fca5a5;
    font-size: 14px;
    text-align: center;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
}

.team-members {
    font-size: 16px;
    margin-bottom: 8px;
    color: #e5e5e5;
}

.login-info {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Chat Interface Styles */
.chat-body {
    height: 100vh;
    overflow: hidden;
}

.chat-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #0a0a0f;
}

.chat-header {
    background: linear-gradient(90deg, rgba(15, 15, 25, 0.95) 0%, rgba(30, 30, 45, 0.95) 100%);
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left h1 {
    font-size: 18px;
    font-weight: 700;
    color: #f59e0b;
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulse 2s infinite;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(15, 15, 25, 0.8);
    border-radius: 20px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.user-avatar {
    font-size: 16px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #cbd5e1;
}

.logout-btn {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #fca5a5;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

.chat-main {
    flex: 1;
    display: flex;
    height: calc(100vh - 64px);
}

.chat-sidebar {
    width: 280px;
    background: linear-gradient(180deg, rgba(15, 15, 25, 0.95) 0%, rgba(10, 10, 15, 0.95) 100%);
    border-right: 1px solid rgba(245, 158, 11, 0.2);
    padding: 24px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sidebar-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
    padding-bottom: 8px;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(15, 15, 25, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(100, 100, 120, 0.2);
    transition: all 0.3s ease;
}

.user-item.online {
    border-color: rgba(16, 185, 129, 0.4);
}

.user-item.bot {
    border-color: rgba(245, 158, 11, 0.4);
}

.user-item:hover {
    transform: translateX(4px);
    background: rgba(15, 15, 25, 0.8);
}

.user-item .user-avatar {
    font-size: 18px;
}

.user-item .user-details {
    flex: 1;
}

.user-item .user-name {
    font-size: 14px;
    font-weight: 600;
    color: #e5e5e5;
}

.user-item .user-status {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-item .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6b7280;
}

.user-item.online .status-dot {
    background: #10b981;
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.6);
}

.system-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(15, 15, 25, 0.4);
    border-radius: 6px;
    border: 1px solid rgba(100, 100, 120, 0.1);
}

.stat-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 12px;
    color: #f59e0b;
    font-weight: 700;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0a0a0f;
    position: relative;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 100%;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(15, 15, 25, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(100, 100, 120, 0.1);
    transition: all 0.3s ease;
    animation: messageAppear 0.3s ease-out;
}

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

.message:hover {
    background: rgba(15, 15, 25, 0.6);
    border-color: rgba(245, 158, 11, 0.2);
}

.message.bot {
    border-left: 3px solid #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.message.human {
    border-left: 3px solid #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.message-avatar {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

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

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.message-sender {
    font-size: 14px;
    font-weight: 700;
    color: #f59e0b;
}

.message-timestamp {
    font-size: 11px;
    color: #64748b;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.message-text {
    font-size: 15px;
    line-height: 1.5;
    color: #e5e5e5;
    word-wrap: break-word;
}

.message-file {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding: 12px;
    background: rgba(15, 15, 25, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(100, 100, 120, 0.2);
}

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

.file-details {
    flex: 1;
}

.file-name {
    font-size: 14px;
    font-weight: 600;
    color: #e5e5e5;
    margin-bottom: 2px;
}

.file-size {
    font-size: 12px;
    color: #94a3b8;
}

.file-preview {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.file-preview:hover {
    transform: scale(1.05);
}

.message-input-container {
    padding: 20px 24px;
    background: linear-gradient(180deg, rgba(15, 15, 25, 0.95) 0%, rgba(10, 10, 15, 0.98) 100%);
    border-top: 1px solid rgba(245, 158, 11, 0.2);
    backdrop-filter: blur(10px);
}

.file-drop-zone {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 158, 11, 0.1);
    border: 2px dashed #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.file-drop-zone.active {
    opacity: 1;
    visibility: visible;
}

.drop-zone-content {
    text-align: center;
    color: #f59e0b;
}

.drop-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.message-input-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: rgba(15, 15, 25, 0.8);
    border: 1px solid rgba(100, 100, 120, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

#messageInput {
    flex: 1;
    background: none;
    border: none;
    color: #e5e5e5;
    font-size: 15px;
    line-height: 1.5;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 120px;
    font-family: inherit;
}

#messageInput::placeholder {
    color: #64748b;
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-btn, .send-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.file-btn {
    background: rgba(100, 100, 120, 0.2);
    color: #94a3b8;
}

.file-btn:hover {
    background: rgba(100, 100, 120, 0.3);
    transform: scale(1.1);
}

.send-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
    font-weight: bold;
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

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

.message-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #64748b;
    margin-left: 4px;
}

.typing-indicator {
    color: #f59e0b;
    font-style: italic;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(15, 15, 25, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 24px;
    min-width: 300px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(100, 100, 120, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.upload-status {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 8px;
}

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

::-webkit-scrollbar-track {
    background: rgba(15, 15, 25, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 158, 11, 0.5);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-main {
        flex-direction: column;
    }
    
    .chat-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(245, 158, 11, 0.2);
        padding: 16px;
        flex-direction: row;
        overflow-x: auto;
        gap: 20px;
    }
    
    .sidebar-section {
        min-width: 200px;
    }
    
    .header-left h1 {
        font-size: 16px;
    }
    
    .user-info {
        display: none;
    }
    
    .message {
        padding: 12px 16px;
    }
    
    .message-input-container {
        padding: 16px;
    }
}