/* ========================================
   CHATBOX WIDGET STYLES
   ======================================== */

.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Figtree', sans-serif;
}

.chat-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2c5aa0, #1e3a5f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(44, 90, 160, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.chat-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.chat-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: #333;
}

.chat-button:hover .chat-tooltip {
    opacity: 1;
    visibility: visible;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(44, 90, 160, 0.4);
}

.chat-button i {
    color: white;
    font-size: 24px;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 420px;
    height: 600px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.chat-window.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

.chat-header {
    background: linear-gradient(135deg, #2c5aa0, #1e3a5f);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
}

.chat-title i {
    margin-right: 8px;
    font-size: 18px;
}

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

.chat-clear,
.chat-minimize,
.chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background 0.2s;
}

.chat-clear:hover,
.chat-minimize:hover,
.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-clear:hover {
    background: rgba(220, 53, 69, 0.3);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

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

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

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, #2c5aa0, #1e3a5f);
    color: white;
}

.user-message .message-avatar {
    background: #e9ecef;
    color: #6c757d;
}

.message-content {
    flex: 1;
    max-width: 80%;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    margin-right: 0;
    margin-left: 10px;
}

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

.message-text {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    line-height: 1.4;
}

.user-message .message-text {
    background: linear-gradient(135deg, #2c5aa0, #1e3a5f);
    color: white;
}

.message-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 5px;
}

.chat-quick-replies {
    padding: 10px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-reply-btn {
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: #2c5aa0;
    color: white;
    border-color: #2c5aa0;
    transform: translateY(-1px);
}

.chat-input {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
}

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

.chat-input input:focus {
    border-color: #2c5aa0;
}

/* Kullanıcı Bilgi Formu */
.chat-user-form {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    max-height: 100%;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-header {
    text-align: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.form-header h4 {
    color: #2c5aa0;
    margin-bottom: 3px;
    font-size: 14px;
}

.form-header p {
    color: #666;
    font-size: 11px;
    margin: 0;
    line-height: 1.2;
}

.form-group {
    margin-bottom: 10px;
    flex-shrink: 0;
}

.form-group input {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 12px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #2c5aa0;
}

.checkbox-group {
    margin-bottom: 10px;
    flex-shrink: 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 10px;
    line-height: 1.2;
    color: #666;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
    margin-top: 1px;
    flex-shrink: 0;
}

/* Form yardım metinleri */
.form-help {
    display: block;
    font-size: 9px;
    color: #666;
    margin-top: 1px;
    line-height: 1.1;
}

/* Form validasyon stilleri - Renklendirmeyi kapat */
.form-group input:invalid,
.form-group input:valid {
    border-color: #ddd !important;
    box-shadow: none !important;
}

.form-group input:focus {
    border-color: #2c5aa0 !important;
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25) !important;
    outline: none;
}

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: auto;
    flex-shrink: 0;
}

.btn-cancel,
.btn-later,
.btn-submit {
    padding: 6px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.btn-cancel {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

.btn-cancel:hover {
    background: #e9ecef;
}

.btn-later {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.btn-later:hover {
    background: #ffeaa7;
}

.btn-submit {
    background: linear-gradient(135deg, #2c5aa0, #1e3a5f);
    color: white;
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.3);
}

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

.chat-send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2c5aa0, #1e3a5f);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.3);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #6c757d;
    font-style: italic;
    font-size: 14px;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #6c757d;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Mobile responsive */
@media (max-width: 768px) {
    .chat-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .chat-window {
        width: 340px;
        max-width: calc(100vw - 30px);
        height: auto;
        bottom: 75px;
        right: 15px;
        border-radius: 15px;
        max-height: 450px;
    }
    
    .chat-header {
        padding: 12px 15px;
    }
    
    .chat-header h4 {
        font-size: 14px;
    }
    
    .chat-status {
        font-size: 11px;
    }
    
    .chat-actions button {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .message {
        padding: 8px;
        font-size: 13px;
    }
    
    .message-text {
        font-size: 13px;
    }
    
    .message-time {
        font-size: 10px;
    }
    
    .quick-reply-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .chat-input input {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .chat-button {
        width: 55px;
        height: 55px;
    }
    
    .chat-button i {
        font-size: 22px;
    }
    
    .chat-tooltip {
        display: none;
    }
}

@media (max-width: 480px) {
    .chat-window {
        width: 320px;
        max-width: calc(100vw - 20px);
        height: auto;
        max-height: 380px;
        bottom: 65px;
        right: 10px;
        border-radius: 12px;
    }
    
    .chat-header {
        padding: 8px 10px;
        min-height: auto;
    }
    
    .chat-header h4 {
        font-size: 12px;
    }
    
    .chat-status {
        font-size: 9px;
    }
    
    .chat-actions button {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .message {
        padding: 5px;
        font-size: 11px;
        gap: 6px;
    }
    
    .message-avatar {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .message-text {
        font-size: 11px;
        line-height: 1.4;
    }
    
    .message-time {
        font-size: 8px;
    }
    
    .chat-quick-replies {
        padding: 6px;
        gap: 4px;
    }
    
    .quick-reply-btn {
        padding: 4px 6px;
        font-size: 9px;
    }
    
    .chat-input {
        padding: 6px 8px;
    }
    
    .chat-input input {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .chat-input button {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
    
    .chat-button {
        width: 48px;
        height: 48px;
    }
    
    .chat-button i {
        font-size: 18px;
    }
    
    .chat-user-form {
        max-height: calc(100vh - 200px);
        padding: 12px;
    }
    
    .form-header h4 {
        font-size: 13px;
    }
    
    .form-header p {
        font-size: 10px;
    }
    
    .form-group input {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .checkbox-label {
        font-size: 9px;
    }
    
    .btn-cancel,
    .btn-later,
    .btn-submit {
        padding: 5px 10px;
        font-size: 10px;
    }
}
