﻿.chat-layout {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    gap: 0;
    flex-direction: row;
    overflow-x: hidden;
}

.chat-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #f5f5f5;
    border-radius: 10px 0 0 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.chat-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 100;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 10px 10px 0;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

.chat-sidebar.closed {
    width: 0;
    opacity: 0;
    transform: translateX(100%);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.btn-new-chat {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-new-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 1);
}

.btn-new-chat .icon {
    font-size: 20px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.sidebar-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.chat-session-item {
    padding: 14px;
    margin-bottom: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
}

.chat-session-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-4px);
    border-color: rgba(255, 255, 255, 0.3);
}

.chat-session-item.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.session-info {
    flex: 1;
    min-width: 0;
}

.session-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    color: #ffffff;
}

.session-time {
    font-size: 11px;
    opacity: 0.8;
    color: rgba(255, 255, 255, 0.85);
}

.session-name-input {
    width: 100%;
    padding: 8px 10px;
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    outline: none;
}

.session-name-input:focus {
    border-color: #ffffff;
}

.session-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chat-session-item:hover .session-actions {
    opacity: 1;
}

.btn-action {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-action:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.btn-action.btn-delete:hover {
    background-color: rgba(220, 53, 69, 0.6);
}

.btn-toggle-sidebar {
    width: 48px;
    height: 100%;
    border: none;
    border-radius: 8px 0 0 8px;
    color: #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    margin-right: -16px;
}

.btn-toggle-sidebar.sidebar-closed {
    right: 0;
    border-radius: 8px 0 0 8px;
}

.chat-header {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    background-color: #ffffff;
    border-radius: 10px 0 0 0;
    margin: -20px -20px 0 -20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;


}

.chat-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

/* Custom scrollbar styles */
.chat-messages::-webkit-scrollbar {
    width: 12px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 3px solid #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #764ba2 0%, #667eea 100%);
}

.message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
}

.user-message {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 1px solid #667eea40;
    text-align: right;
    align-self: flex-end;
    color: #333;
}

.ai-message {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    text-align: left;
    align-self: flex-start;
    color: #333333;
}

/* Loading animation styles */
.loading-animation {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 3px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.button-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: buttonSpin 1s ease-in-out infinite;
}

@keyframes buttonSpin {
    to {
        transform: rotate(360deg);
    }
}

.message-actions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

.audio-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.audio-button:hover {
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
}

.audio-button:disabled,
.audio-button.generating {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.audio-button.playing {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.audio-button.playing:hover {
    background: linear-gradient(135deg, #c82333 0%, #dc3545 100%);
}

.audio-icon {
    font-size: 14px;
    line-height: 1;
}

.audio-button.generating .audio-icon {
    animation: pulse 1s linear infinite;
}

.audio-button.playing .audio-icon {
    animation: blink 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.chat-input-area {
    display: flex;
    margin-top: 10px;
    border-top: 1px solid #ddd;
    padding-top: 10px;
    gap: 10px;
}

.input-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input {
    flex-grow: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
}

.chat-input:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #dee2e6;
}

.voice-controls {
    display: flex;
    align-items: center;
    height: 100%;
}

.voice-button {
    background: #ffffff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .voice-button:hover {
        background: #fafafa;
        transform: scale(1.01);
    }

.voice-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.voice-button.recording {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    animation: recordingPulse 1s ease-in-out infinite;
}

.voice-button.processing {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    cursor: not-allowed;
}


.voice-icon-svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.voice-button:hover .voice-icon-svg {
    transform: scale(1.05);
}

.voice-button.recording .voice-icon-svg {
    animation: micPulse 0.8s ease-in-out infinite;
}

.voice-button.processing .voice-icon-svg {
    animation: spin 1s linear infinite;
}

@keyframes micPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.send-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.3);
}

.send-button:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(102, 126, 234, 0.4);
}

.send-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}