/* Import Font Awesome for icons */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* Premium Chat Interface Design */
.monaco-ai-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 50%, #f1f3f4 100%);
    position: relative;
    padding: 2rem 0;
}

.monaco-ai-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 0, 0, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(227, 0, 44, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 0, 0, 0.01) 0%, transparent 50%);
    pointer-events: none;
}

.chat-header {
    text-align: center;
    padding: 2rem 2rem 1rem;
    position: relative;
    z-index: 2;
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
}

.chat-title {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.chat-subtitle {
    font-size: 1.1rem;
    color: #666;
    margin: 0 0 1rem 0;
    font-weight: 400;
}

.chat-interface {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
    margin: 0 1rem 2rem;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.chat-messages {
    height: 60vh;
    max-height: 600px;
    overflow-y: auto;
    padding: 2rem 2rem 1rem;
    scroll-behavior: smooth;
    background: linear-gradient(to bottom, rgba(248, 249, 250, 0.3), rgba(255, 255, 255, 0.1));
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.message-wrapper {
    margin-bottom: 1.5rem;
    display: flex;
    animation: messageSlide 0.4s ease-out;
}

.user-wrapper {
    justify-content: flex-end;
}

.bot-wrapper {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 80%;
    padding: 1.2rem 1.5rem;
    border-radius: 20px;
    position: relative;
    word-wrap: break-word;
}

.bot-bubble {
    background: #ffffff;
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border-radius: 20px 20px 20px 5px;
}

.user-bubble {
    background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
    color: white;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
    border-radius: 20px 20px 5px 20px;
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    gap: 0.6rem;
}

.bot-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.message-sender {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1a1a1a;
}

.user-bubble .message-sender {
    color: rgba(255, 255, 255, 0.9);
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-left: auto;
}

.welcome-text h3 {
    margin: 0 0 1rem 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
}

.welcome-text p {
    margin: 0 0 1.5rem 0;
    color: #666;
    line-height: 1.6;
    font-size: 1rem;
}

.service-grid {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 15px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-item:hover {
    background: rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.service-icon {
    font-size: 1.6rem;
    width: 45px;
    text-align: center;
    color: #1a1a1a;
}

.service-text strong {
    display: block;
    color: #1a1a1a;
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.service-text span {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
}

.example-queries {
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.examples-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1a1a1a;
    font-size: 0.95rem;
}

.query-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.example-query {
    background: #e3002c;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(227, 0, 44, 0.2);
}

.example-query:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 0, 44, 0.3);
    background: #b8002a;
}

.typing-indicator {
    display: none;
}

.typing-animation {
    display: flex;
    gap: 3px;
    margin-bottom: 0.5rem;
}

.typing-animation span {
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-animation span:nth-child(1) { animation-delay: -0.32s; }
.typing-animation span:nth-child(2) { animation-delay: -0.16s; }
.typing-animation span:nth-child(3) { animation-delay: 0s; }

.typing-text {
    font-style: italic;
    color: #999;
    font-size: 0.85rem;
}

/* Input Container - Separate from chat interface */
.chat-input-container {
    padding: 1.5rem 2rem 2rem;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 10;
    margin: 0 1rem 2rem;
    border-radius: 0 0 25px 25px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
}

.input-wrapper {
    margin-bottom: 1rem;
}

.input-field {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 0.8rem 1.5rem;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.input-field:focus-within {
    border-color: #e3002c;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(227, 0, 44, 0.1);
}

#chatInput {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px; /* Prevents zoom on iOS */
    color: #333;
    outline: none;
    padding: 0.4rem 0;
    font-weight: 400;
}

#chatInput::placeholder {
    color: #999;
}

.send-button {
    width: 40px;
    height: 40px;
    border: none;
    background: #1a1a1a;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 1rem;
}

.send-button:hover {
    background: #333333;
    transform: scale(1.05);
}

.send-button:active {
    transform: scale(0.95);
}

.quick-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.action-button:hover {
    background: #1a1a1a;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.action-button i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.search-results {
    margin-top: 1rem;
    display: grid;
    gap: 0.8rem;
}

.result-card {
    background: rgba(248, 249, 250, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 15px;
    padding: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #e3002c;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.9);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.6rem;
}

.result-title {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 1.05rem;
    line-height: 1.3;
    flex: 1;
    margin-right: 1rem;
}

.result-type {
    padding: 0.25rem 0.7rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.result-type.place {
    background: #28a745;
    color: white;
}

.result-type.ads_type {
    background: #e3002c;
    color: white;
}

.result-type.event {
    background: #ffc107;
    color: #333;
}

.result-info {
    color: #666;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.result-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 0.8rem 0;
    font-size: 0.85rem;
}

.result-detail {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #555;
}

.result-detail i {
    color: #1a1a1a;
    width: 14px;
    opacity: 0.7;
}

.result-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.8rem 0;
}

.feature-tag {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a1a;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.result-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #e3002c;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 0.6rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-link:hover {
    color: #b8002a;
    transform: translateX(2px);
}

/* Animations */
@keyframes typing {
    0%, 80%, 100% { 
        transform: scale(0.8); 
        opacity: 0.5; 
    }
    40% { 
        transform: scale(1); 
        opacity: 1; 
    }
}

@keyframes messageSlide {
    from { 
        opacity: 0; 
        transform: translateY(15px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Mobile Chat-like Interface */
@media (max-width: 768px) {
    .monaco-ai-container {
        padding: 1rem 0;
        min-height: 50vh;
    }
    footer, .copyright-wrapper {
        display: none;
    }
    .blockchat {
        padding: 0 7px;
    }
    .chat-header {
        padding: 0rem 1rem 0.5rem;
    }
    
    .chat-title {
        font-size: 2rem;
    }
    
    .chat-subtitle {
        font-size: 0.95rem;
    }
    
    .chat-interface {
        margin: 0 0.5rem 0;
        border-radius: 20px;
    }
    
    .chat-messages {
        height: calc(100vh - 195px);
        padding: 1rem;
        margin-bottom: 120px;
        max-height: unset;
    }
    .chat-header {
        display:none;
    }
    .message-bubble {
        max-width: 85%;
        padding: 1rem 1.2rem;
    }
    
    .service-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    
    .service-item {
        padding: 0.8rem;
    }
    
    /* Fixed input at bottom for mobile */
    .chat-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.98);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 0;
        backdrop-filter: blur(20px);
        z-index: 1000;
        box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.1);
    }
    
    .input-wrapper {
        margin-bottom: 0.8rem;
    }
    
    .input-field {
        padding: 0.7rem 1.2rem;
    }
    
    .send-button {
        width: 36px;
        height: 36px;
        margin-left: 0.8rem;
    }
    
    .quick-actions {
        gap: 0.4rem;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        justify-content: flex-start;
    }
    
    .action-button {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
        flex-shrink: 0;
    }
    
    .result-header {
        flex-direction: column;
        gap: 0.4rem;
    }
    
    .result-title {
        margin-right: 0;
        font-size: 1rem;
    }
    
    .result-details {
        flex-direction: column;
        gap: 0.4rem;
    }
}

@media (max-width: 480px) {
    .chat-interface {
        margin: 0 0.25rem 0;
    }
    
    .chat-messages {
        padding: 0.8rem;
        margin-bottom: 107px;
    }
    
    .message-bubble {
        padding: 0.8rem 1rem;
    }
    
    .service-icon {
        font-size: 1.4rem;
        width: 35px;
    }
    
    .result-card {
        padding: 1rem;
    }
    
    .quick-actions {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .quick-actions::-webkit-scrollbar {
        display: none;
    }
}

/* Smooth scrolling behavior for mobile */
@media (max-width: 768px) {
    .chat-messages {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    /* Hide scrollbar on mobile */
    .chat-messages::-webkit-scrollbar {
        display: none;
    }
    
    .chat-messages {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
}

/* Ensure footer doesn't interfere with fixed input */
@media (max-width: 768px) {
    body {
        padding-bottom: 0;
    }
    
    /* Add bottom padding to body when input is fixed */
    body.mobile-chat-active {
        padding-bottom: 0px;
    }
    
    /* When near footer, make input relative again */
    .monaco-ai-container.near-footer .chat-input-container {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        margin: 0 0.5rem 2rem;
        border-radius: 0 0 20px 20px;
    }
    
    .monaco-ai-container.near-footer .chat-messages {
        margin-bottom: 0;
    }
}