/* Workshop Assistant Specific Styles */

.workshop-assistant-container {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.workshop-assistant-header {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.workshop-assistant-description {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.workshop-assistant-interface {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-interface {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-messages {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    line-height: 1.4;
}

.chat-message.assistant {
    background: white;
    border: 1px solid #ddd;
    margin-right: auto;
    max-width: 90%;
    padding: 1rem; /* Increased padding for lists */
}

/* Fix list styling within assistant messages */
.chat-message.assistant ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem; /* Ensure bullets stay inside */
}

.chat-message.assistant li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.chat-message.user {
    background: #007bff;
    color: white;
    margin-left: auto;
    text-align: right;
    max-width: 90%;
}

.chat-message strong {
    color: #2c3e50;
    font-weight: 600;
}

.chat-message.user strong {
    color: white;
}

.use-case-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.use-case-label {
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: #495057;
    font-size: 0.9rem;
}

.use-case-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.use-case-btn {
    background: white;
    border: 1px solid #007bff;
    color: #007bff;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.3;
    flex: 1;
    min-width: 150px;
}

.use-case-btn:hover {
    background: #007bff;
    color: white;
    transform: translateY(-1px);
}

.use-case-btn:active {
    transform: translateY(0);
}

.typing-indicator {
    display: none;
    padding: 0.5rem 1rem;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.typing-indicator.active {
    display: block;
}

.chat-input-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
    font-size: 0.9rem;
}

.chat-input-area {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    line-height: 1.4;
}

.chat-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.chat-send {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.6rem 1rem; /* Smaller padding */
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem; /* Smaller font */
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: fit-content;
}

.chat-send:hover:not(:disabled) {
    background: #5a6268;
}

.chat-send:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.rate-limit-info {
    padding: 0.75rem;
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Hide last two precanned questions on mobile */
    .use-case-grid .use-case-btn:nth-child(3),
    .use-case-grid .use-case-btn:nth-child(4) {
        display: none;
    }
    .workshop-assistant-container {
        padding: 0.75rem 0.5rem; /* Much tighter padding */
        margin: 0 -0.5rem; /* Extend closer to screen edges */
    }

    .workshop-assistant-interface {
        padding: 0.5rem 0.25rem; /* Minimal left-right padding */
    }

    .chat-messages {
        padding: 0.75rem 0.5rem; /* Reduced padding */
    }

    /* Ensure lists stay within message bounds on mobile */
    .chat-message.assistant {
        padding: 0.75rem; /* Adequate padding for mobile lists */
    }

    .chat-message.assistant ul {
        padding-left: 1.2rem; /* Slightly less on mobile */
    }

    .use-case-section {
        padding: 0.75rem 0.5rem; /* Reduced padding */
    }

    .use-case-grid {
        flex-direction: column;
    }

    .use-case-btn {
        min-width: auto;
    }

    .chat-input-area {
        flex-direction: column; /* Stack vertically on mobile */
        gap: 0.5rem;
        align-items: stretch;
    }

    .chat-input {
        width: 100%; /* Full width */
        min-height: 60px; /* Smaller height for mobile */
        flex: none; /* Remove flex behavior */
    }

    .chat-send {
        align-self: flex-end; /* Align to right */
        width: auto; /* Auto width */
        min-width: 80px; /* Minimum width for "Send" text */
        flex-shrink: 0;
        padding: 0.6rem 1rem; /* Normal padding for text */
        font-size: 0.85rem; /* Show text again */
        position: static; /* Remove absolute positioning */
    }


    .rate-limit-info {
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
        padding: 0.5rem; /* Reduced padding */
    }
}

/* Extra aggressive spacing for very small screens */
@media (max-width: 480px) {
    .workshop-assistant-container {
        padding: 0.5rem 0.9rem;
        margin: 0 -0.75rem; /* Extend even closer to edges */
    }

    .workshop-assistant-interface {
        padding: 0.5rem 0.1rem; /* Minimal padding */
    }

    .chat-messages {
        padding: 0.5rem 0.25rem;
    }

    .use-case-section {
        padding: 0.5rem 0.25rem;
    }
}
