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

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: rgba(40, 40, 40, 0.95);
    backdrop-filter: blur(10px);
    border-left: 1px solid #555;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #555;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.logo i {
    font-size: 28px;
    color: #c0c0c0;
    background: rgba(192, 192, 192, 0.1);
    padding: 10px;
    border-radius: 10px;
}

.logo h2 {
    font-size: 20px;
    background: linear-gradient(45deg, #c0c0c0, #a0a0a0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.new-chat-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #666 0%, #555 100%);
    color: #e0e0e0;
    border: none;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.new-chat-btn:hover {
    background: linear-gradient(135deg, #777 0%, #666 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.2);
}

.chat-history {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.history-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #aaa;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.history-item.active {
    background: rgba(192, 192, 192, 0.15);
    color: #c0c0c0;
    border-right: 3px solid #c0c0c0;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #555;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #888, #666);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar i {
    color: white;
    font-size: 18px;
}

.clear-history {
    width: 100%;
    padding: 10px;
    background: rgba(100, 100, 100, 0.2);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.clear-history:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #888;
    color: #fff;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(30, 30, 30, 0.95);
}

.chat-header {
    padding: 20px 30px;
    border-bottom: 1px solid #555;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title h1 {
    font-size: 24px;
    margin-bottom: 5px;
    background: linear-gradient(45deg, #fff, #c0c0c0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header-title p {
    color: #aaa;
    font-size: 14px;
}

.model-badge {
    background: rgba(192, 192, 192, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: #c0c0c0;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(192, 192, 192, 0.3);
}

/* Chat Container */
.chat-container {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.welcome-icon {
    font-size: 60px;
    color: #c0c0c0;
    margin-bottom: 20px;
}

.welcome-message h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #fff;
}

.welcome-message p {
    color: #aaa;
    font-size: 16px;
    margin-bottom: 30px;
}

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

.quick-action {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    border-radius: 10px;
    color: #e0e0e0;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.quick-action:hover {
    background: rgba(192, 192, 192, 0.1);
    border-color: #777;
    transform: translateY(-2px);
}

.quick-action i {
    font-size: 20px;
    color: #c0c0c0;
}

/* Message Styles */
.message {
    max-width: 800px;
    padding: 20px;
    border-radius: 15px;
    line-height: 1.6;
    animation: fadeIn 0.3s ease;
}

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

.user-message {
    background: linear-gradient(135deg, rgba(100, 100, 100, 0.3) 0%, rgba(80, 80, 80, 0.3) 100%);
    border: 1px solid rgba(192, 192, 192, 0.2);
    align-self: flex-start;
    margin-right: auto;
}

.ai-message {
    background: rgba(50, 50, 50, 0.7);
    border: 1px solid #444;
    align-self: flex-start;
    margin-right: auto;
}

/* Typing indicator (replaces the loading modal) */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    background: rgba(50, 50, 50, 0.7);
    border: 1px solid #444;
    border-radius: 15px;
    max-width: 120px;
    margin-bottom: 20px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #c0c0c0;
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

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

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

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar {
    background: linear-gradient(135deg, #888, #666);
}

.ai-avatar {
    background: linear-gradient(135deg, #666, #444);
}

.message-avatar i {
    color: white;
    font-size: 14px;
}

.message-sender {
    font-weight: 600;
    font-size: 14px;
}

.user-sender {
    color: #c0c0c0;
}

.ai-sender {
    color: #aaa;
}

.message-content {
    font-size: 15px;
    color: #e0e0e0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-content img {
    max-width: 300px;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid #444;
}

.file-attachment {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.file-info {
    font-size: 14px;
    color: #aaa;
}

.message-time {
    font-size: 12px;
    color: #777;
    margin-top: 10px;
    text-align: left;
}

/* Input Area */
.input-area {
    padding: 20px 30px;
    border-top: 1px solid #555;
    background: rgba(40, 40, 40, 0.95);
}

.upload-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.upload-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #555;
    border-radius: 8px;
    color: #aaa;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-btn:hover {
    background: rgba(192, 192, 192, 0.1);
    color: #c0c0c0;
    border-color: #888;
}

.input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

textarea {
    flex: 1;
    min-height: 50px;
    max-height: 150px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #555;
    border-radius: 12px;
    color: #e0e0e0;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
}

textarea:focus {
    border-color: #888;
    background: rgba(255, 255, 255, 0.08);
}

textarea::placeholder {
    color: #777;
}

.send-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #666 0%, #555 100%);
    border: none;
    border-radius: 12px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: linear-gradient(135deg, #777 0%, #666 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.2);
}

.send-btn:disabled {
    background: #444;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: #777;
}

.input-footer {
    margin-top: 10px;
}

.file-info {
    color: #c0c0c0;
    font-size: 14px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.disclaimer {
    color: #777;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(192, 192, 192, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(192, 192, 192, 0.8);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 200px;
        border-left: none;
        border-bottom: 1px solid #555;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .chat-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}