/* Chat Interface Styles - Complements styles.css */

/* Main Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
}

/* Welcome Screen - Google-style centered */
.chat-container {
    height: calc(100vh - 60px);
    margin-top: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.welcome-screen {
    text-align: center;
    width: 100%;
    max-width: 600px;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-screen.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    position: absolute;
}

.welcome-title {
    font-size: 48px;
    font-weight: 400;
    margin-bottom: 40px;
    color: var(--text-color);
    letter-spacing: -1px;
    opacity: 0.9;
}

/* Search Form - Clean and minimal */
.search-form {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 16px 50px 16px 24px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    background: var(--card-bg);
    color: var(--text-color);
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-input:focus {
    border-color: var(--link-color);
    box-shadow: 0 2px 8px var(--card-shadow);
}

.search-input::placeholder {
    color: var(--text-color-secondary);
    opacity: 0.6;
}

.search-submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--link-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
}

.search-submit:hover {
    background: var(--link-color);
    transform: translateY(-50%) scale(1.05);
}

.search-submit:active {
    transform: translateY(-50%) scale(0.95);
}

/* Chat Interface */
.chat-interface {
    width: 100%;
    max-width: 800px;
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.chat-interface.hidden {
    display: none;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.chat-header h2 {
    font-size: 20px;
    font-weight: 400;
    color: var(--text-color);
    margin: 0;
}

.new-chat-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
    font-size: 18px;
}

.new-chat-btn:hover {
    background: var(--hover-bg);
    transform: scale(1.05);
}

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

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

.message {
    margin-bottom: 24px;
    animation: messageSlide 0.3s ease-out;
}

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

.message-user {
    text-align: right;
}

.message-content {
    display: inline-block;
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-user .message-content {
    background: var(--link-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-ai .message-content {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    will-change: opacity;
}

/* Subtle fade for streaming updates */
@keyframes streamFade {
    from { opacity: 0.92; }
    to { opacity: 1; }
}

.message-ai .message-content.streaming {
    animation: streamFade 140ms ease-in;
}

/* Chat Form */
.chat-form {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.chat-input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 18px;
    font-size: 15px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    background: var(--card-bg);
    color: var(--text-color);
    outline: none;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    font-family: inherit;
    transition: all 0.3s ease;
}

.chat-input:focus {
    border-color: var(--link-color);
}

.chat-input::placeholder {
    color: var(--text-color-secondary);
    opacity: 0.6;
}

.chat-submit {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--link-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
}

.chat-submit:hover:not(:disabled) {
    transform: scale(1.05);
}

.chat-submit:active:not(:disabled) {
    transform: scale(0.95);
}

.chat-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading animation */
.loading-dots {
    display: inline-flex;
    gap: 4px;
    padding: 12px 18px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-color-secondary);
    animation: loadingDot 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

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

/* Responsive */
@media (max-width: 600px) {
    .welcome-title {
        font-size: 36px;
    }
    
    .search-input {
        font-size: 14px;
        padding: 14px 46px 14px 20px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .chat-interface {
        max-width: 100%;
    }
    
    .header-content {
        padding: 0 16px;
    }
    
    .new-chat-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* Dark mode specific adjustments */
body.dark-theme .search-submit,
body.dark-theme .chat-submit {
    background: var(--link-color);
}

body.dark-theme .message-user .message-content {
    background: var(--link-color);
}

/* Scrollbar styling */
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-color-secondary);
}

/* Keyboard shortcuts help */
.keyboard-help {
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--text-color-secondary);
    opacity: 0.5;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.keyboard-help:hover {
    opacity: 0.8;
}

.shortcut-hint {
    display: flex;
    align-items: center;
    gap: 4px;
}

kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    font-family: monospace;
    line-height: 1.2;
    color: var(--text-color);
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    box-shadow: 0 1px 2px var(--card-shadow);
}

/* Hide keyboard help on mobile */
@media (max-width: 600px) {
    .keyboard-help {
        display: none;
    }
}
