/* ThinkFlow - Clean Professional CSS */

/* Scrollbar - minimal */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

/* KaTeX */
.katex {
    font-size: 1.05em !important;
}

/* Prevent selecting hidden MathML - only select visible HTML */
.katex-mathml {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.katex-display {
    margin: 1rem 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0;
}

/* Textarea sizing */
textarea {
    field-sizing: content;
}

/* Animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.animate-bounce {
    animation: bounce 0.6s ease-in-out infinite;
}

/* Focus states */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* No tap highlight */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Message styles */
#messages > div {
    animation: fadeIn 0.3s ease-out;
}

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

/* iOS safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    footer {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
}

/* Selection */
::selection {
    background: rgba(59, 130, 246, 0.3);
}

/* Code styling */
code {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
    background: rgba(63, 63, 70, 0.5);
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

pre code {
    background: none;
    padding: 0;
}

pre {
    background: #18181b;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

/* Smooth scroll */
#chatContainer {
    scroll-behavior: smooth;
}

/* Hide scrollbar on mobile */
@media (max-width: 640px) {
    #chatContainer::-webkit-scrollbar {
        width: 0;
    }
}

/* User dropdown positioning */
#userDropdown {
    z-index: 100;
}

/* Quiz toggle states */
.quiz-opt.border-blue-500 {
    background: rgba(59, 130, 246, 0.1);
}

.pract-opt:not(.border-green-500):not(.border-red-500):hover {
    border-color: #52525b;
}

/* Message bubbles */
.user-message {
    background: #27272a;
    border-radius: 1.25rem;
    padding: 1rem 1.25rem;
    max-width: 85%;
    margin-left: auto;
}

.assistant-message {
    max-width: 100%;
}

.assistant-message p {
    line-height: 1.7;
    color: #d4d4d8;
}

.assistant-message h1,
.assistant-message h2,
.assistant-message h3 {
    color: #fafafa;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

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

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

.assistant-message li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

/* Step cards */
.step-card {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}

.step-card:hover {
    border-color: #3f3f46;
}

/* Method buttons */
.method-btn {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 10px;
    padding: 0.875rem 1rem;
    transition: all 0.15s ease;
}

.method-btn:hover {
    border-color: #3f3f46;
    background: #1f1f23;
}

.method-btn.border-blue-500 {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

/* Quick prompts */
.quick-prompt {
    transition: all 0.15s ease;
}

/* Typing indicator */
.typing-dot {
    width: 8px;
    height: 8px;
    background: #71717a;
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(1) { animation-delay: 0ms; }
.typing-dot:nth-child(2) { animation-delay: 200ms; }
.typing-dot:nth-child(3) { animation-delay: 400ms; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* History items */
.history-item {
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.history-item:hover {
    background: #27272a;
}

/* Star rating */
.star-btn.active {
    color: #facc15;
}

/* Feedback type buttons */
.feedback-type.active {
    border-color: #3b82f6;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .user-message {
        max-width: 90%;
    }
    
    #messages {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Print styles */
@media print {
    header, footer, #userMenu, #historyBtn {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}
