/* AI Coach Section Styles */

.coach-container {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
}

.coach-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.coach-header h2 {
    color: #00CED1;
    font-size: 1.75rem;
    margin: 0 0 0.5rem 0;
}

.coach-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin: 0;
}

/* Quick Prompts */
.quick-prompts {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.quick-prompt {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.quick-prompt:hover {
    background: rgba(0, 206, 209, 0.15);
    border-color: rgba(0, 206, 209, 0.3);
    color: #00CED1;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    max-width: 85%;
}

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.message-content {
    padding: 0.875rem 1.25rem;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 0.9375rem;
}

.message.user .message-content {
    background: linear-gradient(135deg, #00CED1, #00a8a8);
    color: #0a0a0a;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: typing 1.4s infinite both;
}

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

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

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

/* Chat Input */
.chat-input-container {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.chat-form {
    display: flex;
    gap: 0.75rem;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 0.75rem 1.25rem;
    color: white;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #00CED1;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chat-send-btn {
    background: linear-gradient(135deg, #00CED1, #00a8a8);
    border: none;
    border-radius: 24px;
    padding: 0.75rem 1.5rem;
    color: #0a0a0a;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

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

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

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

/* Markdown Styling in Messages */
.message-content h1,
.message-content h2,
.message-content h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.message-content h1 { font-size: 1.25rem; }
.message-content h2 { font-size: 1.125rem; }
.message-content h3 { font-size: 1rem; }

.message-content p {
    margin: 0.5rem 0;
}

.message-content ul,
.message-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-content li {
    margin: 0.25rem 0;
}

.message-content code {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.875em;
}

.message-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.message-content pre code {
    background: none;
    padding: 0;
}

.message-content strong {
    font-weight: 600;
}

.message-content em {
    font-style: italic;
}

/* Error Message */
.message.error .message-content {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.3);
    color: #fca5a5;
}

/* Empty State */
.coach-not-connected {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.coach-not-connected-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.coach-not-connected h3 {
    color: white;
    margin-bottom: 0.5rem;
}

.coach-not-connected p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.5rem;
    max-width: 400px;
}

/* Responsive */
@media (max-width: 768px) {
    .coach-container {
        padding: 1rem;
        height: calc(100vh - 100px);
    }

    .quick-prompts {
        gap: 0.5rem;
    }

    .quick-prompt {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .message {
        max-width: 90%;
    }

    .chat-form {
        flex-direction: column;
    }

    .chat-send-btn {
        width: 100%;
    }
}
