/* 
   PROFESSIONAL UI IMPROVEMENTS
   Add these styles to your existing style.css
   
   These improvements add:
   - Smooth animations
   - Better loading states
   - Professional polish
   - Modern micro-interactions
*/

/* ==================== LOADING SCREEN ==================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-screen.fade-out {
    opacity: 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-screen p {
    color: white;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 500;
}

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

/* ==================== CONNECTION STATUS ==================== */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 13px;
    color: #94a3b8;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    animation: pulse 2s infinite;
}

.status-dot.thinking {
    background: #f59e0b;
    animation: pulse 1s infinite;
}

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

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

/* ==================== IMPROVED CHAT HEADER ==================== */
.avatar {
    position: relative;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border: 2px solid #1e293b;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.subtitle {
    font-size: 13px !important;
    opacity: 0.7;
}

/* ==================== MESSAGE IMPROVEMENTS ==================== */
.message {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.message.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.message-timestamp {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    margin-left: 48px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #64748b;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* ==================== IMPROVED INPUT AREA ==================== */
.chat-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

#user-input {
    resize: none;
    min-height: 44px;
    max-height: 150px;
    overflow-y: auto;
    border-radius: 12px;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    border: 2px solid #334155;
    background: #1e293b;
    color: #f1f5f9;
    transition: all 0.2s ease;
}

#user-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.char-counter {
    font-size: 12px;
    color: #64748b;
    transition: color 0.2s ease;
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

/* ==================== SUGGESTED QUESTIONS ==================== */
.suggested-questions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.suggestion-chip {
    padding: 8px 16px;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 20px;
    color: #e2e8f0;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-chip:hover {
    background: #475569;
    border-color: #667eea;
    transform: translateY(-2px);
}

/* ==================== SCROLL TO BOTTOM BUTTON ==================== */
.scroll-to-bottom {
    position: absolute;
    bottom: 120px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.scroll-to-bottom.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.scroll-to-bottom:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

/* ==================== CAROUSEL IMPROVEMENTS ==================== */
.slide-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: white;
}

.collage-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.collage-item:hover .collage-overlay {
    opacity: 1;
}

.collage-item {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
    position: relative;
}

.collage-item:hover {
    transform: scale(1.05);
    z-index: 2;
}

/* Better social buttons */
.social-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.social-btn:hover::before {
    left: 100%;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* ==================== FOOTER ==================== */
.site-footer {
    text-align: center;
    padding: 20px;
    background: #0f172a;
    color: #64748b;
    font-size: 13px;
    border-top: 1px solid #1e293b;
}

/* ==================== RESPONSIVE IMPROVEMENTS ==================== */
@media (max-width: 768px) {
    .connection-status {
        display: none; /* Hide on mobile to save space */
    }
    
    .suggested-questions {
        display: none; /* Can be overwhelming on mobile */
    }
    
    .scroll-to-bottom {
        bottom: 100px;
        right: 16px;
        width: 36px;
        height: 36px;
    }
}

/* ==================== ACCESSIBILITY ==================== */
.send-btn:focus-visible,
.carousel-btn:focus-visible,
.social-btn:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bubble {
        border: 2px solid currentColor;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}