:root {
    --coach-primary: #10b981;
    --coach-primary-glow: rgba(16, 185, 129, 0.3);
    --coach-primary-light: #34d399;
    --coach-bg: rgba(20, 29, 48, 0.98);
    --coach-bg-glass: rgba(30, 41, 59, 0.9);
    --coach-border: rgba(255, 255, 255, 0.08);
    --coach-text: #e7eaf0;
    --coach-text-muted: #94a3b8;
}

.coach-bottom-chat {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9990;
    width: 100%;
    max-width: 560px;
    font-family: var(--font-sans, Inter, system-ui, sans-serif);
}

.coach-chat-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--coach-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--coach-border);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.coach-chat-bar:hover {
    background: rgba(30, 41, 59, 0.98);
}

.coach-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.coach-bar-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--coach-primary), #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--coach-primary-glow);
}

.coach-bar-avatar i {
    font-size: 16px;
    color: white;
}

.coach-bar-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--coach-text);
}

.coach-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.coach-bar-chips {
    display: flex;
    gap: 6px;
}

.coach-chip {
    padding: 5px 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    font-size: 12px;
    color: var(--coach-primary-light);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.coach-chip:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--coach-primary);
    transform: translateY(-1px);
}

.coach-chip i {
    font-size: 11px;
}

.coach-bar-toggle {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--coach-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--coach-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.coach-bar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--coach-text);
}

.coach-chat-window {
    display: none;
    flex-direction: column;
    background: var(--coach-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--coach-border);
    border-top: none;
    height: 400px;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
}

.coach-bottom-chat.expanded .coach-chat-bar {
    display: none;
}

.coach-bottom-chat.expanded .coach-chat-window {
    display: flex;
    border-radius: 16px 16px 0 0;
}

.coach-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--coach-border);
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, transparent 100%);
    border-radius: 16px 16px 0 0;
}

.coach-window-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.coach-window-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--coach-primary), #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px var(--coach-primary-glow);
}

.coach-window-avatar i {
    font-size: 18px;
    color: white;
}

.coach-window-title h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--coach-text) !important;
    margin: 0;
}

.coach-window-title p {
    font-size: 12px;
    color: var(--coach-text-muted) !important;
    margin: 0;
}

.coach-window-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.coach-clear-btn,
.coach-minimize-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--coach-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--coach-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.coach-clear-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.coach-minimize-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--coach-text);
}

.coach-quick-chips {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--coach-border);
    overflow-x: auto;
}

.coach-chip-lg {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--coach-border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--coach-text);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.coach-chip-lg:hover {
    background: var(--coach-primary-glow);
    border-color: rgba(16, 185, 129, 0.5);
    color: var(--coach-primary-light);
    transform: translateY(-1px);
}

.coach-chip-lg i {
    font-size: 14px;
    color: var(--coach-primary);
}

.coach-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

.coach-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.coach-welcome-msg,
.coach-message {
    display: flex;
    gap: 10px;
    animation: coachFadeIn 0.3s ease;
}

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

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

.coach-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--coach-primary), #059669);
}

.coach-message.user .coach-msg-avatar {
    background: rgba(99, 102, 241, 0.8);
}

.coach-msg-avatar i {
    font-size: 14px;
    color: white;
}

.coach-msg-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    background: var(--coach-bg-glass);
    border: 1px solid var(--coach-border);
    color: var(--coach-text);
    border-bottom-left-radius: 4px;
}

.coach-msg-bubble p {
    margin: 0 0 8px;
    color: var(--coach-text) !important;
}

.coach-msg-bubble p:last-child {
    margin-bottom: 0;
}

.coach-msg-bubble ul {
    margin: 8px 0;
    padding-left: 18px;
}

.coach-msg-bubble li {
    margin: 4px 0;
    color: var(--coach-text) !important;
}

.coach-msg-bubble strong {
    color: var(--coach-primary-light) !important;
}

.coach-message.user .coach-msg-bubble {
    background: linear-gradient(135deg, var(--coach-primary), #059669);
    border: none;
    color: white;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 14px;
}

.coach-message.user .coach-msg-bubble p,
.coach-message.user .coach-msg-bubble li,
.coach-message.user .coach-msg-bubble strong {
    color: white !important;
}

.coach-typing {
    display: flex;
    gap: 10px;
    padding: 0 16px;
    margin-bottom: 8px;
}

.coach-typing-bubble {
    padding: 10px 14px;
    background: var(--coach-bg-glass);
    border: 1px solid var(--coach-border);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}

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

.coach-typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--coach-primary);
    border-radius: 50%;
    animation: coachTyping 1.4s infinite;
}

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

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

.coach-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--coach-border);
    background: rgba(0, 0, 0, 0.15);
}

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

.coach-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--coach-border);
    border-radius: 12px;
    color: var(--coach-text);
    font-size: 13px;
    resize: none;
    min-height: 40px;
    max-height: 100px;
    transition: all 0.2s ease;
    font-family: inherit;
}

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

.coach-input:focus {
    outline: none;
    border-color: var(--coach-primary);
    box-shadow: 0 0 0 3px var(--coach-primary-glow);
}

.coach-send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--coach-primary), #059669);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.coach-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--coach-primary-glow);
}

.coach-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.coach-send-btn i {
    font-size: 16px;
    color: white;
}

.coach-input-footer {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.coach-powered {
    font-size: 10px;
    color: var(--coach-text-muted);
    opacity: 0.7;
}

@media (max-width: 600px) {
    .coach-bottom-chat {
        max-width: 100%;
        left: 0;
        transform: none;
    }
    
    .coach-chat-bar {
        border-radius: 0;
        padding: 8px 12px;
    }
    
    .coach-bar-chips {
        display: none;
    }
    
    .coach-chat-window {
        height: 50vh;
        min-height: 300px;
    }
    
    .coach-bottom-chat.expanded .coach-chat-window {
        border-radius: 0;
    }
    
    .coach-window-header {
        border-radius: 0;
    }
}

@media (max-width: 400px) {
    .coach-quick-chips {
        padding: 10px 12px;
        gap: 6px;
    }
    
    .coach-chip-lg {
        padding: 6px 10px;
        font-size: 12px;
    }
}
