/**
 * TekVwa Properties - Live Chat Widget Styles
 */

/* Chat Toggle Button */
.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3f 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(26, 71, 42, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 9998;
    transition: all 0.3s ease;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(26, 71, 42, 0.5);
}

.chat-toggle:active {
    transform: scale(0.95);
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.chat-window.open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3f 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header h4 {
    margin: 0;
    font-size: 1.1em;
}

.chat-status {
    font-size: 0.8em;
    opacity: 0.9;
}

.chat-status.online {
    color: #90EE90;
}

.chat-status.waiting {
    color: #FFD700;
}

.chat-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

/* Start Form */
.chat-start-form {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.chat-welcome {
    text-align: center;
    margin-bottom: 25px;
}

.chat-welcome h3 {
    margin: 0 0 10px;
    font-size: 1.5em;
    color: #333;
}

.chat-welcome p {
    margin: 0;
    color: #666;
}

.chat-form-group {
    margin-bottom: 15px;
}

.chat-form-group input,
.chat-form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-form-group input:focus,
.chat-form-group select:focus {
    outline: none;
    border-color: #1a472a;
    box-shadow: 0 0 0 3px rgba(26, 71, 42, 0.1);
}

.chat-start-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3f 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-start-btn:hover {
    background: linear-gradient(135deg, #15391f 0%, #254a35 100%);
    transform: translateY(-1px);
}

.chat-start-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.chat-faq-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 0.9em;
}

.chat-faq-link a {
    color: #1a472a;
    font-weight: 500;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}

#chat-messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 16px;
    font-size: 0.95em;
    line-height: 1.4;
}

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3f 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.staff {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-message.system {
    align-self: center;
    background: #e9ecef;
    color: #666;
    font-size: 0.85em;
    text-align: center;
    border-radius: 20px;
    max-width: 90%;
}

.msg-sender {
    display: block;
    font-size: 0.75em;
    font-weight: 600;
    color: #1a472a;
    margin-bottom: 4px;
}

.msg-content {
    word-break: break-word;
}

.msg-time {
    display: block;
    font-size: 0.7em;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

.chat-message.user .msg-time {
    color: rgba(255, 255, 255, 0.8);
}

/* Input Area */
.chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

#chat-message-form {
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 0.95em;
    transition: border-color 0.2s;
}

#chat-input:focus {
    outline: none;
    border-color: #1a472a;
}

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

.chat-send-btn:hover {
    transform: scale(1.05);
}

/* Closed State */
.chat-closed {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.chat-closed p {
    color: #666;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 480px) {
    .chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .chat-toggle {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
