/* Modern UI Override Styles - 2024-2025 Design Standards */
/* Created: 2025-10-22 */

/* ===== ROOT VARIABLES OVERRIDE ===== */
:root {
    /* Modern Color Palette - Monochrome with single accent */
    --primary-color: #0066cc;  /* Professional blue accent */
    --primary-light: #3384db;
    --primary-dark: #0052a3;
    --primary-gradient: #0066cc;  /* Solid color, no gradient */
    --secondary-color: #666666;
    --secondary-light: #999999;
    --accent-color: #0066cc;
    --success-color: #00aa00;
    --warning-color: #ff9500;
    --error-color: #ff3333;

    /* Modern Background - Clean and minimal */
    --bg-gradient-primary: #f8f9fa;  /* Solid light gray, no gradient */
    --bg-gradient-secondary: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.98);  /* Almost opaque */
    --glass-border: rgba(0, 0, 0, 0.08);  /* Subtle border */
    --glass-backdrop: none;  /* Remove blur effect */

    /* Modern Typography */
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;

    /* Flat Shadows - Minimal depth */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 3px 6px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-2xl: 0 5px 10px rgba(0, 0, 0, 0.15);

    /* Modern Border Radius - Subtle curves */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;
    --radius-2xl: 12px;
    --radius-full: 50%;  /* Only for avatars */
}

/* ===== GLOBAL OVERRIDES ===== */
body {
    background: #f8f9fa !important;  /* Solid light background */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif !important;
}

/* Remove background pattern overlay */
body::before {
    display: none !important;
}

/* ===== APP CONTAINER ===== */
.app-container {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 0 !important;  /* Sharp corners on mobile */
}

@media (min-width: 769px) {
    .app-container {
        border-radius: 8px !important;  /* Subtle radius on desktop */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    }
}

/* ===== HEADER ===== */
.app-header {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid #e0e0e0 !important;
    background-image: none !important;  /* Remove gradient overlay */
}

.logo-icon {
    background: #0066cc !important;  /* Solid color */
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* Remove shimmer animation */
.logo-icon::before {
    display: none !important;
}

.logo-text {
    background: none !important;
    -webkit-text-fill-color: #1a1a1a !important;
    color: #1a1a1a !important;
}

/* Remove pulse animation from status dot */
.status-dot {
    animation: none !important;
    box-shadow: none !important;
}

/* ===== MESSAGES ===== */
.message-avatar {
    background: #0066cc !important;
    border-radius: 8px !important;  /* Square with subtle radius */
    width: 36px !important;
    height: 36px !important;
}

.message-avatar::before {
    display: none !important;  /* Remove decorative elements */
}

.message-bubble {
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    padding: 12px 16px !important;
}

.ai-message .message-bubble {
    background: #f0f0f0 !important;  /* Solid light gray */
    border-top-left-radius: 4px !important;
}

.user-message .message-bubble {
    background: #0066cc !important;
    border-top-right-radius: 4px !important;
}

/* Remove message animations */
.message {
    animation: none !important;
}

.fade-in {
    animation: none !important;
    opacity: 1 !important;
}

/* ===== TYPING INDICATOR ===== */
.typing-bubble {
    border-radius: 8px !important;
    background: #f0f0f0 !important;
}

.typing-dots span {
    background: #666666 !important;
    animation: none !important;  /* Remove dot animation for performance */
}

/* Simple fade animation only */
@keyframes simpleFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.typing-dots span {
    animation: simpleFade 0.5s infinite alternate !important;
}

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

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

/* ===== INPUT AREA ===== */
.input-area {
    background: #ffffff !important;
    border-top: 1px solid #e0e0e0 !important;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05) !important;
    padding-bottom: 100px !important;  /* Space for sticky ad */
    background-image: none !important;
}

.message-input {
    background: #f8f9fa !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

.message-input:focus {
    border-color: #0066cc !important;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1) !important;
}

.send-button {
    background: #0066cc !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

.send-button::before {
    display: none !important;  /* Remove decorative overlay */
}

.send-button:hover:not(:disabled) {
    background: #0052a3 !important;
    transform: none !important;  /* Remove scale effect */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.send-button:disabled {
    background: #cccccc !important;
    opacity: 0.6 !important;
}

/* ===== PROFILE CARD ===== */
.profile-card {
    background: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.profile-card::before {
    display: none !important;
}

.profile-header {
    background: #0066cc !important;
    border-radius: 8px 8px 0 0 !important;
}

.profile-header::before {
    display: none !important;
}

.close-button {
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px !important;
}

.close-button::before {
    display: none !important;
}

.action-button {
    border-radius: 6px !important;
    box-shadow: none !important;
    font-weight: 500 !important;
}

.action-button.primary {
    background: #0066cc !important;
}

.action-button.primary::before {
    display: none !important;
}

.action-button.primary:hover {
    background: #0052a3 !important;
    transform: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.action-button.secondary {
    background: #f0f0f0 !important;
    color: #333333 !important;
}

.action-button.secondary:hover {
    background: #e0e0e0 !important;
}

/* ===== PROGRESS STEPS ===== */
.step-indicator {
    background: #f0f0f0 !important;
    border-radius: 4px !important;
}

.step.active .step-indicator {
    background: #0066cc !important;
}

.progress-fill {
    background: #0066cc !important;
}

/* ===== STICKY AD CONTAINER ===== */
.sticky-ad-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sticky-ad-container > div {
    width: 320px;
    height: 100px;
    margin: 0 auto;
}

/* Adjust container for ad space */
.app-container {
    height: calc(100vh - 100px) !important;
    height: calc(100dvh - 100px) !important;
}

.messages-area {
    padding-bottom: 210px !important;  /* 100px ad + 88px input + 22px buffer */
}

/* Fix input area positioning and width */
.input-area {
    position: fixed !important;  /* Change from absolute to fixed */
    bottom: 100px !important;  /* Position above ad */
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-width: 500px !important;  /* Match container width */
    width: 100% !important;
    z-index: 20 !important;
}

/* Desktop adjustments - constrain ad container */
@media (min-width: 769px) {
    .sticky-ad-container {
        left: 50% !important;
        transform: translateX(-50%) !important;
        max-width: 500px !important;  /* Match chat container width */
        width: 100% !important;
        border-radius: 8px 8px 0 0 !important;  /* Rounded top corners */
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .sticky-ad-container {
        height: 80px;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .sticky-ad-container > div {
        transform: scale(0.8);
        transform-origin: center;
    }

    .app-container {
        height: calc(100vh - 80px) !important;
        height: calc(100dvh - 80px) !important;
    }

    .messages-area {
        padding-bottom: 180px !important;  /* 80px ad + 88px input + 12px buffer */
    }

    .input-area {
        position: fixed !important;
        bottom: 80px !important;
        left: 0 !important;
        transform: none !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* ===== ADDITIONAL LAYOUT FIXES ===== */
/* Ensure proper scrolling and visibility */
.chat-container {
    height: calc(100% - 60px) !important;  /* Account for header */
    overflow: hidden !important;
}

.chat-wrapper {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.messages-area {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scroll-behavior: smooth !important;
}

/* Ensure messages scroll to bottom properly */
.messages-area::-webkit-scrollbar-track {
    margin-bottom: 200px;  /* Desktop */
}

@media (max-width: 768px) {
    .messages-area::-webkit-scrollbar-track {
        margin-bottom: 180px;  /* Mobile */
    }
}

/* ===== REMOVE ALL UNNECESSARY ANIMATIONS ===== */
@keyframes shimmer { from { opacity: 1; } to { opacity: 1; } }
@keyframes pulse-glow { from { opacity: 1; } to { opacity: 1; } }
@keyframes typing-shimmer { from { opacity: 1; } to { opacity: 1; } }
@keyframes fadeIn { from { opacity: 1; } to { opacity: 1; } }
@keyframes fadeInScale { from { opacity: 1; transform: scale(1); } to { opacity: 1; transform: scale(1); } }
@keyframes slideIn { from { transform: translateX(0); } to { transform: translateX(0); } }
@keyframes slideUp { from { transform: translateY(0); } to { transform: translateY(0); } }

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
* {
    /* Disable all transitions for better performance */
    /* transition: none !important; */
}

/* Only keep essential transitions */
.message-input,
.send-button,
.action-button {
    transition: all 0.15s ease-out !important;
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 6px !important;
}

::-webkit-scrollbar-track {
    background: #f0f0f0 !important;
}

::-webkit-scrollbar-thumb {
    background: #cccccc !important;
    border-radius: 3px !important;
}

::-webkit-scrollbar-thumb:hover {
    background: #999999 !important;
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    background: #f8f9fa !important;  /* Match new background */
}

.loader-icon {
    animation: none !important;
    color: #0066cc !important;
}

.loader-text,
.loader-subtext {
    color: #333333 !important;
}

/* ===== FINAL OVERRIDES ===== */
/* Ensure no gradient backgrounds remain */
*[style*="gradient"] {
    background-image: none !important;
}

/* Reduce all excessive border radius */
*[style*="border-radius: 2"],
*[style*="border-radius: 3"],
*[style*="border-radius: 4"],
*[style*="border-radius: 5"] {
    border-radius: 8px !important;
}

/* Fix for mobile full-screen */
@media (max-width: 768px) {
    .app-container {
        max-width: 100% !important;
        width: 100vw !important;
        height: calc(100vh - 80px) !important;
        height: calc(100dvh - 80px) !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        position: relative !important;
    }
}