/* ============================================
   AI COACH CHAT MODAL STYLES
   VIP Exclusive Chat Interface
   ============================================ */

/* Modal Overlay & Container */
.coach-chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.coach-chat-modal.active {
    opacity: 1;
    pointer-events: all;
}

.coach-chat-modal.closing {
    opacity: 0;
}

.coach-chat-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.coach-chat-container {
    position: relative;
    width: 90%;
    max-width: 600px;
    height: 90vh;
    max-height: 700px;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.coach-chat-modal.active .coach-chat-container {
    transform: scale(1) translateY(0);
}

/* Chat Header */
.coach-chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    border-radius: 20px 20px 0 0;
}

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

.chat-coach-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    object-fit: cover;
}

.chat-coach-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.chat-coach-info p {
    margin: 2px 0 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.chat-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

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

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* Messages Area */
.coach-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.coach-chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.coach-chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.coach-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Welcome Message */
.chat-welcome {
    text-align: center;
    padding: 40px 20px;
    margin: auto;
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.chat-welcome h4 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.chat-welcome p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Chat Messages */
.chat-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: slideInMessage 0.3s ease;
}

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

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    object-fit: cover;
    flex-shrink: 0;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 75%;
}

.chat-message.user .message-content {
    align-items: flex-end;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.user .message-bubble {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 8px;
}

/* Typing Indicator */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing-bounce 1.4s infinite;
}

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

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

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

/* Quick Actions */
.chat-quick-actions {
    padding: 12px 20px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.chat-quick-actions::-webkit-scrollbar {
    height: 4px;
}

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

.chat-quick-actions::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.quick-action-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-action-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.quick-action-btn i {
    font-size: 12px;
}

/* Input Area */
.coach-chat-input {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 0 0 20px 20px;
}

.input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-wrapper input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.send-btn:active {
    transform: scale(0.95);
}

.chat-footer-text {
    margin-top: 8px;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.chat-footer-text i {
    color: var(--primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .coach-chat-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }

    .coach-chat-header {
        border-radius: 0;
    }

    .coach-chat-input {
        border-radius: 0;
    }

    .message-content {
        max-width: 85%;
    }

    .chat-quick-actions {
        gap: 6px;
        padding: 8px 16px;
    }

    .quick-action-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Smooth appearance animation */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
