/* YouTube Transcript AI Chat - Frontend Chat Widget Styles */

.ytai-chat-widget {
    max-width: 800px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ytai-chat-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.ytai-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    text-align: center;
}

.ytai-chat-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.ytai-chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
}

.ytai-message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

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

.ytai-message-user,
.ytai-message-bot {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
}

.ytai-message-user {
    background: #667eea;
    color: #fff;
    margin-left: auto;
    text-align: right;
}

.ytai-message-bot {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
}

.ytai-message-content {
    word-wrap: break-word;
}

.ytai-message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
}

.ytai-loading {
    display: none;
    padding: 10px;
    text-align: center;
}

.ytai-loading.active {
    display: block;
}

.ytai-typing-indicator {
    display: inline-block;
}

.ytai-typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.ytai-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.ytai-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.ytai-chat-input-container {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #ddd;
}

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

.ytai-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.ytai-chat-input:focus {
    border-color: #667eea;
}

.ytai-chat-submit {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ytai-chat-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ytai-chat-submit:active {
    transform: translateY(0);
}

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

.ytai-error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #c33;
}

.ytai-welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.ytai-welcome-message h4 {
    margin: 0 0 10px 0;
    color: #333;
}

/* Scrollbar styling */
.ytai-chat-messages::-webkit-scrollbar {
    width: 8px;
}

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

.ytai-chat-messages::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.ytai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ytai-chat-widget {
        margin: 10px;
    }
    
    .ytai-chat-messages {
        height: 300px;
    }
    
    .ytai-message-user,
    .ytai-message-bot {
        max-width: 90%;
    }
    
    .ytai-chat-input-container {
        padding: 15px;
    }
}
