/**
 * TheUphrates AI ChatBox Integration Styles
 * Mevcut Extendable teması ile uyumlu AI chat stilleri
 */

/* Floating Chat Widget */
.theuphrates-floating-chat {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.floating-chat-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.floating-chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

.chat-icon {
    font-size: 24px;
    color: white;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.floating-chat-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.floating-chat-window .chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.floating-chat-window .chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ai-model-selector {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-chat-window .chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
}

.floating-chat-window .ai-message,
.floating-chat-window .user-message {
    margin-bottom: 15px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    max-width: 85%;
    word-wrap: break-word;
}

.floating-chat-window .ai-message {
    background: white;
    border: 1px solid #e9ecef;
}

.floating-chat-window .user-message {
    background: #007bff;
    color: white;
    margin-left: auto;
}

.floating-chat-window .chat-input {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    background: white;
}

.floating-chat-window .chat-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
}

.floating-chat-window .chat-input input:focus {
    border-color: #667eea;
}

.floating-chat-window .send-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.floating-chat-window .send-btn:hover {
    background: #764ba2;
}

.chat-footer {
    padding: 10px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.token-counter {
    color: #6c757d;
}

.full-chat-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.full-chat-link:hover {
    color: #764ba2;
}

/* Language Switcher */
.theuphrates-lang-switcher {
    display: inline-block;
}

.lang-select {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

/* Full Chat Page Styles */
.theuphrates-ai-chat-full {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

.chat-full-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
}

.chat-full-header h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 700;
}

.chat-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.model-selector label {
    font-weight: 600;
    margin: 0;
}

.model-selector select {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

.token-display {
    text-align: right;
}

.token-bar {
    width: 150px;
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    margin-top: 5px;
    overflow: hidden;
}

.token-progress {
    height: 100%;
    background: #4ecdc4;
    transition: width 0.3s ease;
}

.chat-full-container {
    display: flex;
    flex-direction: column;
    height: 600px;
}

.chat-full-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.chat-full-messages .ai-message,
.chat-full-messages .user-message {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
    gap: 12px;
}

.chat-full-messages .user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.chat-full-messages .ai-message .message-avatar {
    background: #667eea;
    color: white;
}

.chat-full-messages .user-message .message-avatar {
    background: #007bff;
    color: white;
}

.message-content {
    max-width: 70%;
    background: white;
    padding: 15px 18px;
    border-radius: 15px;
    border: 1px solid #e9ecef;
}

.chat-full-messages .user-message .message-content {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.message-header strong {
    font-weight: 600;
    font-size: 14px;
}

.message-time {
    font-size: 12px;
    opacity: 0.7;
}

.message-text {
    line-height: 1.5;
    font-size: 15px;
}

.message-text ul {
    margin: 10px 0;
    padding-left: 20px;
}

.message-text li {
    margin-bottom: 5px;
}

.chat-full-input {
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.input-group {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.input-group textarea {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px 18px;
    font-size: 15px;
    resize: none;
    outline: none;
    font-family: inherit;
    transition: border-color 0.3s ease;
    max-height: 120px;
}

.input-group textarea:focus {
    border-color: #667eea;
}

.input-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.send-full-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    min-width: 100px;
    transition: all 0.3s ease;
}

.send-full-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.send-full-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Dashboard Styles */
.theuphrates-ai-dashboard {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.user-plan {
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px 20px;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 28px;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.dashboard-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.action-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 15px;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-btn.secondary {
    background: #28a745;
    color: white;
}

.action-btn.outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.dashboard-info {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
}

.dashboard-info h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #333;
}

.ai-models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.model-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease;
    border: 2px solid transparent;
}

.model-card:hover {
    transform: translateY(-3px);
    border-color: rgba(102, 126, 234, 0.3);
}

.model-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.model-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.model-desc {
    font-size: 13px;
    color: #6c757d;
}

/* Login Required Message */
.ai-login-required {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #ddd;
    font-size: 16px;
    color: #6c757d;
}

.ai-login-required a {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.ai-login-required a:hover {
    color: #764ba2;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .floating-chat-window {
        width: 300px;
        height: 450px;
    }
    
    .theuphrates-ai-chat-full {
        margin: 10px;
    }
    
    .chat-full-container {
        height: 500px;
    }
    
    .chat-info {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .user-info {
        align-items: center;
    }
    
    .dashboard-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-actions {
        width: 100%;
    }
    
    .send-full-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .floating-chat-toggle {
        width: 50px;
        height: 50px;
    }
    
    .chat-icon {
        font-size: 20px;
    }
    
    .floating-chat-window {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 60px;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .ai-models-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation for smooth transitions */
@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.floating-chat-window[style*="block"] {
    animation: slideInUp 0.3s ease;
}

.chat-full-messages .ai-message,
.chat-full-messages .user-message {
    animation: slideInUp 0.3s ease;
}

/* Loading animation */
.btn-loading {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar,
.chat-full-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.chat-full-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb,
.chat-full-messages::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.chat-full-messages::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}