/* Main CSS for Pal AI */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    font-family: 'Inter', sans-serif;
}

/* Typing Animation */
.typing-dots {
    animation: typing 1s infinite ease-in-out;
}

.typing-dots:nth-child(1) { animation-delay: 0s; }
.typing-dots:nth-child(2) { animation-delay: 0.15s; }
.typing-dots:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* Sidebar Transitions */
.sidebar-transition {
    transition: transform 0.2s ease;
}

.smooth-hover {
    transition: background-color 0.15s ease;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.3);
    border-radius: 2px;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(75, 85, 99, 0.3);
}

/* Mobile Optimization */
.mobile-optimized {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (max-width: 768px) {
    .sidebar-mobile {
        width: 90vw;
        max-width: 320px;
    }
    
    .mobile-chat-input {
        padding: 12px 16px;
    }
    
    .mobile-header {
        padding: 12px 16px;
    }
    
    .mobile-message {
        padding: 16px 12px;
    }
    
    .mobile-message .message-wrap {
        max-width: calc(100vw - 100px);
    }
    
    .mobile-input-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .mobile-input-container .message-input-wrapper {
        order: 1;
    }
    
    .mobile-input-container .send-button-wrapper {
        order: 2;
        align-self: flex-end;
    }
}

/* Message Wrapping */
.message-wrap {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Copy Button */
.copy-btn {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.group:hover .copy-btn {
    opacity: 1;
}

/* Message Content Formatting */
.message-content h1, .message-content h2, .message-content h3 {
    font-weight: bold;
    margin: 8px 0;
}

.message-content strong {
    font-weight: 600;
}

.message-content em {
    font-style: italic;
}

.message-content code {
    background: rgba(0,0,0,0.1);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.dark .message-content code {
    background: rgba(255,255,255,0.1);
}

.message-content pre {
    background: rgba(0,0,0,0.05);
    padding: 12px;
    border-radius: 8px;
    margin: 8px 0;
    overflow-x: auto;
}

.dark .message-content pre {
    background: rgba(255,255,255,0.05);
}

.message-content ul, .message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 4px 0;
}

/* Enhanced Typing Area like Claude */
.typing-area {
    background: #ffffff;
    border: none;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.dark .typing-area {
    background: #1f2937;
}

.typing-area textarea {
    border: none !important;
    background: transparent !important;
    resize: none;
    padding: 16px 60px 16px 20px;
    font-size: 16px;
    line-height: 1.5;
    max-height: 200px;
    box-shadow: none !important;
    outline: none !important;
}

.typing-area textarea:focus {
    outline: none !important;
    ring: 0 !important;
    border: none !important;
}

/* Chat Layout */
#chatView {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#chatContainer {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Input Area */
.input-area {
    flex-shrink: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 16px;
}

.dark .input-area {
    background: #111111;
    border-top-color: #2a2a2a;
}

/* Claude-style Send Button */
.send-btn-claude {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 18px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.send-btn-claude:hover:not(:disabled) {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.send-btn-claude:active {
    transform: translateY(-50%) scale(0.95);
}

.send-btn-claude:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #9ca3af;
}

.send-btn-claude i {
    font-size: 16px;
}

/* Profile Setup */
.profile-setup-form {
    display: none;
}

.profile-setup-form.active {
    display: block;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .typing-area {
        border-radius: 16px;
    }
    
    .typing-area textarea {
        padding: 14px 50px 14px 16px;
        font-size: 16px;
    }
    
    .send-btn-claude {
        width: 32px;
        height: 32px;
        right: 6px;
    }
    
    .send-btn-claude i {
        font-size: 14px;
    }
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* RTL Support */
[dir="rtl"] .message-wrap {
    text-align: right;
}

[dir="rtl"] .typing-area textarea {
    padding: 16px 20px 16px 60px;
}

[dir="rtl"] .send-btn-claude {
    right: auto;
    left: 8px;
}

[dir="rtl"] .mobile-message .message-wrap {
    text-align: right;
}

/* Welcome Modal Styles */
.welcome-modal-overlay {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.welcome-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .welcome-modal-content {
    background: rgba(26, 26, 26, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

.welcome-button {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.welcome-button:hover {
    transform: translateY(-1px);
}

.welcome-button:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .welcome-modal-content {
        margin: 16px;
        padding: 24px;
    }
} 