/* AI Assistant page styles */
.ai-container { padding: 1.25rem; }

.chat-section { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }

.examples-section {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.08);
}

.examples-section h2 {
    color: #e6f2ff;
    font-size: 1rem;
    margin: 0 0 12px 0;
    font-weight: 600;
}

.example-queries {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.example-query {
    background: rgba(0, 120, 255, 0.12);
    border: 1px solid rgba(0, 120, 255, 0.35);
    color: #d7ecff;
    padding: 10px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
    line-height: 1.3;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 100%;
    text-align: left;
}

.example-query:hover {
    background: rgba(0, 150, 255, 0.18);
    border-color: rgba(0, 150, 255, 0.45);
    transform: translateY(-1px);
}

.example-query:active { transform: translateY(0); }
.chat-window { background: rgba(255,255,255,0.05); border-radius: 12px; padding: 1rem; height: 420px; overflow-y: auto; border: 1px solid rgba(255,255,255,0.1); }
.chat-form { display: flex; gap: 0.5rem; }

/* Typing indicator */
.chat-bubble.typing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.typing-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0,255,150,0.8);
    opacity: 0.4;
    animation: blink 1.2s infinite ease-in-out;
}

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

@keyframes blink {
    0% { opacity: 0.3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
    80% { opacity: 0.3; transform: translateY(0); }
    100% { opacity: 0.3; transform: translateY(0); }
}
.chat-input { flex: 1; padding: 0.75rem 1rem; border: 1px solid rgba(255,255,255,0.15); border-radius: 10px; background: rgba(0,0,0,0.2); color: #fff; }
.chat-bubble { max-width: 80%; padding: 0.6rem 0.9rem; border-radius: 12px; margin: 0.25rem 0; line-height: 1.35; }
.chat-bubble.user { background: rgba(0,150,255,0.15); border: 1px solid rgba(0,150,255,0.3); align-self: flex-end; margin-left: auto; }
.chat-bubble.ai { background: rgba(0,255,150,0.12); border: 1px solid rgba(0,255,150,0.28); align-self: flex-start; margin-right: auto; }
.chat-hint { opacity: 0.7; font-size: 0.9rem; }

/* Subtle legal hint under input */
.chat-hint--legal { opacity: 0.6; font-size: 0.85rem; }

/* Legal disclaimer block */
.legal-disclaimer {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Calculation trace styles */
.calc-trace {
    margin: 0.5rem 0;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
}

.trace-details {
    margin: 0;
}

.trace-summary {
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    border-radius: 10px;
    transition: all 0.2s ease;
    user-select: none;
    list-style: none;
    outline: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trace-summary::-webkit-details-marker {
    display: none;
}

.trace-summary:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.95);
}

.trace-content {
    padding: 0 1rem 1rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 0.5rem;
}

.trace-section {
    margin-bottom: 1rem;
}

.trace-section h4 {
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trace-step {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.trace-step.planning {
    border-left: 3px solid rgba(100,200,255,0.5);
}

.trace-step.calculation {
    border-left: 3px solid rgba(0,255,150,0.5);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.step-number {
    background: rgba(0,255,150,0.2);
    color: rgba(0,255,150,0.9);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

.tool-name {
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.source-badge {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: auto;
}

.step-inputs, .step-formula, .step-results {
    margin: 0.3rem 0;
    color: rgba(255,255,255,0.8);
}

.step-inputs strong, .step-formula strong, .step-results strong {
    color: rgba(255,255,255,0.95);
}

.step-error {
    color: rgba(255,100,100,0.9);
    background: rgba(255,100,100,0.1);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    margin: 0.3rem 0;
}

.trace-meta {
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    text-align: center;
}

.trace-meta small {
    font-size: 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .source-badge {
        margin-left: 0;
    }
}
