/* Chat Page Specific Styles */
.chat-page {
    background-color: #f8f9fa;
    min-height: 100vh;
}

.chat-page .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Chat Header */
.chat-header {
    background-color: #fff;
    border-bottom: 1px solid #dadce0;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.chat-logo {
    height: 32px;
    width: auto;
}

.chat-title {
    font-size: 20px;
    font-weight: 400;
    color: #202124;
    margin: 0;
}

.chat-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Chat Controls */
.chat-controls {
    background-color: #fff;
    border-bottom: 1px solid #dadce0;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    flex-shrink: 0;
}

.model-selection {
    display: flex;
    align-items: center;
    gap: 15px;
}

.model-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-group label {
    font-size: 14px;
    color: #5f6368;
    font-weight: 500;
}

.model-group select {
    padding: 6px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    color: #202124;
    min-width: 120px;
}

.model-group select:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.chat-action-btn {
    padding: 8px 16px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    background-color: #fff;
    color: #5f6368;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-action-btn:hover {
    background-color: #f8f9fa;
    border-color: #1a73e8;
    color: #1a73e8;
}

/* Main Chat Area */
.chat-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

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

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Chat Input Area */
.chat-input-area {
    border-top: 1px solid #dadce0;
    background-color: #fff;
    padding: 20px;
    flex-shrink: 0;
}

.quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.quick-action {
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #dadce0;
    border-radius: 16px;
    color: #5f6368;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-action:hover {
    background-color: #e8f0fe;
    border-color: #1a73e8;
    color: #1a73e8;
}

.input-container {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.message-input {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 16px;
    border: 1px solid #dadce0;
    border-radius: 22px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    resize: none;
    overflow-y: auto;
    background-color: #fff;
    transition: all 0.2s;
}

.message-input:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.message-input::placeholder {
    color: #9aa0a6;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding: 0 16px;
}

.char-count {
    font-size: 12px;
    color: #70757a;
}

.send-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #1a73e8;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    background-color: #1557b0;
}

.send-button:disabled {
    background-color: #dadce0;
    cursor: not-allowed;
}

.send-button svg {
    width: 20px;
    height: 20px;
}

/* Chat Sidebar */
.chat-sidebar {
    width: 300px;
    background-color: #f8f9fa;
    border-left: 1px solid #dadce0;
    padding: 20px;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px;
    color: #202124;
}

.sidebar-ad {
    background-color: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.ad-placeholder {
    color: #70757a;
    font-size: 12px;
    padding: 20px;
    border: 1px dashed #dadce0;
    border-radius: 4px;
    background-color: #f8f9fa;
}

/* Chat History Styles */
.chat-history {
    max-height: 400px;
    overflow-y: auto;
}

.chat-history-item {
    background-color: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-history-item:hover {
    background-color: #f1f3f4;
    border-color: #1a73e8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chat-history-item .chat-title {
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    margin-bottom: 4px;
    line-height: 1.3;
}

.chat-history-item .chat-time {
    font-size: 12px;
    color: #70757a;
    margin-bottom: 2px;
}

.chat-history-item .chat-count {
    font-size: 11px;
    color: #5f6368;
    font-style: italic;
}

.chat-history::-webkit-scrollbar {
    width: 6px;
}

.chat-history::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-history::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-page .container {
        height: 100vh;
    }
    
    .chat-header {
        padding: 10px 15px;
    }
    
    .chat-header-left {
        gap: 15px;
    }
    
    .chat-title {
        font-size: 18px;
    }
    
    .chat-controls {
        padding: 10px 15px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .model-selection {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .model-group {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .model-group select {
        min-width: auto;
    }
    
    .chat-actions {
        justify-content: center;
    }
    
    .chat-main {
        flex-direction: column;
    }
    
    .chat-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #dadce0;
        order: -1;
        max-height: 200px;
    }
    
    .chat-input-area {
        padding: 15px;
    }
    
    .quick-actions {
        justify-content: center;
    }
    
    .input-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .send-button {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .chat-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .chat-header-right {
        justify-content: center;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-action {
        text-align: center;
    }
    
    .message-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Animation for smooth transitions */
.message {
    animation: fadeInUp 0.3s ease-out;
}

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

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .chat-page {
        background-color: #202124;
    }
    
    .chat-header,
    .chat-controls,
    .chat-content,
    .chat-input-area {
        background-color: #303134;
        border-color: #5f6368;
    }
    
    .chat-title {
        color: #e8eaed;
    }
    
    .model-group label {
        color: #9aa0a6;
    }
    
    .model-group select {
        background-color: #303134;
        color: #e8eaed;
        border-color: #5f6368;
    }
    
    .chat-action-btn {
        background-color: #303134;
        color: #9aa0a6;
        border-color: #5f6368;
    }
    
    .message-input {
        background-color: #303134;
        color: #e8eaed;
        border-color: #5f6368;
    }
    
    .message-input::placeholder {
        color: #5f6368;
    }
    
    .quick-action {
        background-color: #303134;
        color: #9aa0a6;
        border-color: #5f6368;
    }
    
    .assistant-message .message-text {
        background-color: #303134;
        color: #e8eaed;
    }
    
    .char-count {
        color: #9aa0a6;
    }
}