/* === LLM Credit Header === */
/* Cost Estimate Modal */
.llm-cost-estimate-modal {
    max-width: 500px;
}

.cost-estimate-display {
    text-align: left;
}

.topic-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--theme-border);
}

.topic-info h4 {
    margin: 0;
    color: var(--theme-text);
    font-size: 1.1em;
}

.difficulty-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    text-transform: capitalize;
}

.difficulty-badge.beginner {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

.difficulty-badge.intermediate {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.difficulty-badge.advanced {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.cost-breakdown {
    margin-bottom: 15px;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cost-item.primary .cost-value {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--theme-accent);
}

.cost-item.secondary .cost-value {
    color: var(--theme-text-secondary);
}

.cost-label {
    color: var(--theme-text-secondary);
}

.cost-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: var(--theme-text-secondary);
    margin-top: 10px;
    padding: 8px 12px;
    background-color: rgba(74, 144, 226, 0.1);
    border-radius: 6px;
}

.estimate-disclaimer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: var(--theme-neutral);
    margin-top: 15px;
    padding: 8px 12px;
    background-color: rgba(255, 170, 0, 0.1);
    border-radius: 6px;
}

.cost-estimate-loading,
.cost-estimate-error {
    text-align: center;
    padding: 20px;
    color: var(--theme-text-secondary);
}

.cost-estimate-error {
    color: var(--theme-bearish);
}

.fallback-estimate {
    margin-top: 10px;
    font-weight: 500;
    color: var(--theme-text);
}

.cost-estimate-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--theme-border);
}

.llm-topic-pricing {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.9em;
    color: var(--theme-text-secondary);
}

.llm-topic-pricing::before {
    content: "💰";
    font-size: 0.8em;
}

/* Hover state adjustment */
.llm-topic-tag:hover .llm-topic-pricing {
    color: rgba(255, 255, 255, 0.9);
}

/* Add to existing credit header styles */
.llm-refresh-balance-btn {
    background-color: transparent;
    color: var(--theme-text-secondary);
    border: 1px solid var(--theme-border);
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.llm-refresh-balance-btn:hover {
    background-color: var(--theme-section-hover-bg);
    color: var(--theme-accent);
    border-color: var(--theme-accent);
}

.llm-refresh-balance-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.llm-refresh-balance-btn.refreshing i {
    animation: spin 1s linear infinite;
}
.llm-credit-header {
    display: flex;
    justify-content: flex-end;
    padding: 15px 20px 10px 20px;
    border-bottom: 1px solid var(--theme-border);
    background-color: var(--theme-background);
}

.llm-credit-display {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95em;
}

.credit-label {
    color: var(--theme-text-secondary);
    font-weight: 500;
}

.credit-balance {
    color: var(--theme-accent);
    font-weight: 600;
    font-family: var(--font-data);
    min-width: 60px;
    text-align: right;
}

.llm-topup-btn {
    background-color: var(--theme-accent);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s;
}

.llm-topup-btn:hover {
    background-color: #3a80d2;
}

.llm-topup-btn:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* === Credit Purchase Modal === */
.llm-credit-modal {
    max-width: 500px;
}

.credit-modal-description {
    margin-bottom: 20px;
    color: var(--theme-text-secondary);
    text-align: center;
}

.credit-purchase-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.credit-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    border: 2px solid var(--theme-border);
    border-radius: 8px;
    background-color: var(--theme-section-bg);
    cursor: pointer;
    transition: all 0.2s;
}

.credit-option:hover {
    border-color: var(--theme-accent);
    background-color: var(--theme-section-hover-bg);
}

.credit-option.selected {
    border-color: var(--theme-accent);
    background-color: var(--theme-accent);
    color: white;
}

.credit-option-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.credit-option-amount {
    font-weight: 600;
    font-size: 1.1em;
}

.credit-option-description {
    font-size: 0.85em;
    opacity: 0.8;
}

.credit-option-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.credit-option-price {
    font-weight: 600;
    font-family: var(--font-data);
    color: var(--theme-accent);
}

.credit-option.selected .credit-option-price {
    color: white;
}

.credit-option-loading {
    font-size: 0.8em;
    color: var(--theme-text-secondary);
    font-style: italic;
}

.credit-loading {
    text-align: center;
    padding: 40px;
    color: var(--theme-text-secondary);
}

.llm-credit-status {
    min-height: 1.5em;
    text-align: center;
    font-size: 0.9em;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .llm-credit-header {
        padding: 12px 15px 8px 15px;
    }

    .llm-credit-display {
        gap: 8px;
        font-size: 0.9em;
    }

    .llm-topup-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    .credit-balance {
        min-width: 50px;
    }
}

@media (max-width: 480px) {
    .credit-option {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .credit-option-right {
        align-items: center;
    }
}
/* LLM/AI Assistant Specific Styles */
/* === Topics Header with Refresh Button === */
.llm-topics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.llm-topics-header h3 {
    margin: 0;
    color: var(--theme-accent);
    font-size: 1.2em;
    font-family: var(--font-headings);
    font-weight: var(--font-weight-heading);
}

.llm-refresh-topics-btn {
    background-color: var(--theme-accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.9em;
}

.llm-refresh-topics-btn:hover {
    background-color: #3a80d2;
    transform: rotate(180deg);
}

.llm-refresh-topics-btn:disabled {
    background-color: #999;
    cursor: not-allowed;
    transform: none;
}

.llm-refresh-topics-btn i {
    transition: transform 0.3s ease;
}

/* === LLM Container and Layout === */
.llm-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - 2rem); /* Full height minus header and padding */
    overflow: hidden;
}

.llm-scrollable-content {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 20px;
}

.llm-response-window {
    background-color: var(--theme-section-bg);
    border-radius: 8px;
    margin-bottom: 20px;
    min-height: 200px;
    padding: 20px;
}

.llm-empty-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--theme-text-secondary);
    text-align: center;
}

.llm-empty-chat-icon {
    font-size: 3em;
    margin-bottom: 20px;
    color: var(--theme-accent);
}

.llm-empty-chat h3 {
    margin: 0 0 10px 0;
    color: var(--theme-accent);
    font-family: var(--font-headings);
}

/* === Message Styles === */
.llm-message {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6;
    max-width: 85%;
    clear: both;
}

.llm-user-message {
    background-color: var(--theme-accent);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    float: right;
}

.llm-assistant-message {
    background-color: var(--theme-background);
    color: var(--theme-text);
    margin-right: auto;
    border-bottom-left-radius: 4px;
    float: left;
    border: 1px solid var(--theme-border);
}

.llm-message .llm-meta {
    font-size: 0.8em;
    color: var(--theme-text-secondary);
    margin-bottom: 6px;
    display: block;
    font-weight: 500;
}

.llm-user-message .llm-meta {
    color: rgba(255, 255, 255, 0.8);
}

/* === Markdown Content in Assistant Messages === */
.llm-assistant-message .llm-content h1,
.llm-assistant-message .llm-content h2,
.llm-assistant-message .llm-content h3,
.llm-assistant-message .llm-content h4,
.llm-assistant-message .llm-content h5,
.llm-assistant-message .llm-content h6 {
    margin: 15px 0 10px 0;
    color: var(--theme-text);
    font-weight: var(--font-weight-heading);
    font-family: var(--font-headings);
}

.llm-assistant-message .llm-content h1 { 
    font-size: 1.4em; 
    border-bottom: 2px solid var(--theme-accent); 
    padding-bottom: 5px; 
}

.llm-assistant-message .llm-content h2 { 
    font-size: 1.2em; 
    border-bottom: 1px solid var(--theme-border); 
    padding-bottom: 3px; 
}

.llm-assistant-message .llm-content h3 { 
    font-size: 1.1em; 
}

.llm-assistant-message .llm-content p { 
    margin: 10px 0; 
    line-height: 1.6; 
}

.llm-assistant-message .llm-content ul, 
.llm-assistant-message .llm-content ol { 
    margin: 10px 0; 
    padding-left: 25px; 
}

.llm-assistant-message .llm-content li { 
    margin: 5px 0; 
}

.llm-assistant-message .llm-content code {
    background-color: var(--theme-background);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: var(--font-data);
    font-size: 0.9em;
    color: var(--theme-accent);
    border: 1px solid var(--theme-border);
}

.llm-assistant-message .llm-content pre {
    background-color: var(--theme-background);
    border: 1px solid var(--theme-border);
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
    overflow-x: auto;
    font-family: var(--font-data);
    font-size: 0.9em;
}

.llm-assistant-message .llm-content pre code {
    background-color: transparent;
    padding: 0;
    color: var(--theme-text);
    border: none;
}

.llm-assistant-message .llm-content blockquote {
    border-left: 4px solid var(--theme-accent);
    margin: 15px 0;
    padding: 10px 15px;
    background-color: var(--theme-background);
    font-style: italic;
}

.llm-assistant-message .llm-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
}

.llm-assistant-message .llm-content th,
.llm-assistant-message .llm-content td {
    border: 1px solid var(--theme-border);
    padding: 8px 12px;
    text-align: left;
}

.llm-assistant-message .llm-content th {
    background-color: var(--theme-section-hover-bg);
    font-weight: var(--font-weight-heading);
    color: var(--theme-text);
}

.llm-assistant-message .llm-content a {
    color: var(--theme-accent);
    text-decoration: none;
}

.llm-assistant-message .llm-content a:hover {
    text-decoration: underline;
}

.llm-assistant-message .llm-content strong {
    font-weight: var(--font-weight-heading);
}

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

/* === Topics Section === */
.llm-topics-section {
    padding: 20px;
    border-top: 1px solid var(--theme-border);
    background-color: var(--theme-background);
    border-radius: 8px;
    margin-bottom: 20px;
}

.llm-topics-section h3 {
    margin: 0 0 15px 0;
    color: var(--theme-accent);
    font-size: 1.2em;
    font-family: var(--font-headings);
    font-weight: var(--font-weight-heading);
}

.llm-topics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: stretch; /* Ensure cards have equal height */
}

.llm-topic-tag {
    background-color: var(--theme-section-bg);
    border: 2px solid var(--theme-accent);
    color: var(--theme-text);
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
    max-width: 280px;
    text-align: left;
}

.llm-topic-tag:hover {
    background-color: var(--theme-accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}
.llm-topic-title {
    font-weight: 600;
    font-size: 1em;
    line-height: 1.3;
    margin: 0;
}
.llm-topic-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75em;
    opacity: 0.8;
}
.llm-topic-difficulty {
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
    text-transform: capitalize;
}
.llm-topic-difficulty.beginner {
    background-color: #28a745;
    color: white;
}
.llm-topic-difficulty.intermediate {
    background-color: #ffc107;
    color: #212529;
}

.llm-topic-difficulty.advanced {
    background-color: #dc3545;
    color: white;
}

.llm-topic-credits {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
}

.llm-topic-credits::before {
    content: "💰";
    font-size: 0.9em;
}

/* Hover state adjustments */
.llm-topic-tag:hover .llm-topic-difficulty.beginner {
    background-color: rgba(40, 167, 69, 0.9);
    color: white;
}

.llm-topic-tag:hover .llm-topic-difficulty.intermediate {
    background-color: rgba(255, 193, 7, 0.9);
    color: #212529;
}

.llm-topic-tag:hover .llm-topic-difficulty.advanced {
    background-color: rgba(220, 53, 69, 0.9);
    color: white;
}
/* === Related Topics Area === */
.llm-related-topics-area {
    padding: 15px 20px;
    border-top: 1px solid var(--theme-border);
    background-color: var(--theme-section-bg);
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--theme-accent);
}
.llm-related-topics-area h4::before {
    content: "🔗";
    font-size: 1.2em;
}
.llm-related-topics-area h4 {
    margin: 0 0 12px 0;
    font-size: 1.1em;
    color: var(--theme-accent);
    font-weight: var(--font-weight-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.llm-related-topics-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.llm-related-topic-tag::before {
    content: "📚";
    font-size: 0.9em;
}

.llm-related-topic-tag:hover {
    background-color: var(--theme-accent);
    color: white;
    border-color: var(--theme-accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
}

.llm-related-topics-loading {
    color: var(--theme-text-secondary);
    font-style: italic;
    font-size: 0.9em;
}

.llm-related-topics-error {
    color: var(--theme-bearish);
    font-size: 0.9em;
    padding: 8px 12px;
    background-color: rgba(255, 61, 113, 0.1);
    border-radius: 6px;
}

.llm-related-topic-tag {
    display: inline-flex;
    align-items: center;
    background-color: var(--theme-background);
    color: var(--theme-text);
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--theme-border);
    font-weight: 500;
    gap: 6px;
}

.llm-related-topics-container span {
    display: inline-block;
    background-color: var(--theme-text-secondary);
    color: var(--theme-background);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.llm-related-topics-container span:hover {
    background-color: var(--theme-text);
}

/* === Fixed Prompt Area === */
.llm-fixed-prompt-area {
    padding: 15px 20px;
    background-color: var(--theme-section-hover-bg);
    border-top: 1px solid var(--theme-border);
    color: var(--theme-text-secondary);
    font-size: 0.95em;
    text-align: center;
    font-style: italic;
    border-radius: 8px;
}

/* === User Input Area === */
.llm-user-input-area {
    display: flex;
    padding: 15px 20px;
    background-color: var(--theme-background);
    align-items: flex-end;
    gap: 10px;
    border-top: 1px solid var(--theme-border);
    flex-shrink: 0;
}

.llm-input-controls {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.llm-control-btn {
    padding: 10px 12px;
    background-color: var(--theme-text-secondary);
    color: var(--theme-background);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s;
}

.llm-control-btn:hover {
    background-color: var(--theme-text);
}

.llm-control-btn.llm-new-topic {
    background-color: var(--theme-neutral);
    color: var(--theme-background);
}

.llm-control-btn.llm-new-topic:hover {
    background-color: #e6a100;
}

.llm-user-input-area textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--theme-border);
    border-radius: 6px;
    resize: none;
    font-family: var(--font-body);
    font-size: 1em;
    min-height: 40px;
    max-height: 120px;
    background-color: var(--theme-section-bg);
    color: var(--theme-text);
}

.llm-user-input-area textarea:focus {
    outline: none;
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

.llm-send-btn {
    padding: 12px 18px;
    background-color: var(--theme-accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    height: 40px;
    min-width: 80px;
    font-weight: 500;
}

.llm-send-btn:hover {
    background-color: #3a80d2;
}

.llm-send-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
    opacity: 0.7;
}

/* === Thinking Indicators === */
.llm-thinking-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
}

.llm-thinking-pulse {
    animation: llmThinkingPulse 1.5s ease-in-out infinite;
}

@keyframes llmThinkingPulse {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.1);
    }
}

.llm-thinking-dots {
    display: inline-flex;
    gap: 2px;
    margin-left: 4px;
}

.llm-thinking-dots span {
    width: 4px;
    height: 4px;
    background-color: var(--theme-accent);
    border-radius: 50%;
    animation: llmThinkingDots 1.4s infinite;
}

.llm-thinking-dots span:nth-child(1) { animation-delay: 0ms; }
.llm-thinking-dots span:nth-child(2) { animation-delay: 200ms; }
.llm-thinking-dots span:nth-child(3) { animation-delay: 400ms; }

@keyframes llmThinkingDots {
    0%, 80%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* === Modal Styles === */
.llm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.llm-modal-content {
    background-color: var(--theme-section-bg);
    border-radius: 8px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 80%;
    overflow: hidden;
    border: 1px solid var(--theme-border);
}

.llm-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--theme-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--theme-background);
}

.llm-modal-header h3 {
    margin: 0;
    color: var(--theme-accent);
    font-size: 1.3em;
    font-family: var(--font-headings);
    font-weight: var(--font-weight-heading);
}

.llm-close-modal {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--theme-text-secondary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.llm-close-modal:hover {
    color: var(--theme-accent);
}

.llm-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
}

.llm-conversation-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--theme-border);
    cursor: pointer;
    transition: background-color 0.2s;
}

.llm-conversation-item:hover {
    background-color: var(--theme-section-hover-bg);
}

.llm-conversation-item:last-child {
    border-bottom: none;
}

.llm-conversation-title {
    font-weight: 500;
    color: var(--theme-text);
    margin-bottom: 4px;
}

.llm-conversation-meta {
    font-size: 0.85em;
    color: var(--theme-text-secondary);
}

/* === Enhanced Animations and Transitions === */
.llm-topics-section,
.llm-related-topics-area {
    animation: slideInUp 0.3s ease-out;
}

.llm-response-window {
    animation: fadeIn 0.4s ease-out;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* === Topic Selection Animation === */
.llm-topic-tag.selected {
    background-color: var(--theme-accent) !important;
    color: white !important;
    transform: scale(0.95);
    animation: topicSelected 0.6s ease-out;
}

@keyframes topicSelected {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(0.95);
        box-shadow: 0 0 20px rgba(74, 144, 226, 0.6);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
    }
}

/* === Enhanced Loading States === */
.llm-topics-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 40px 20px;
    color: var(--theme-text-secondary);
}

.llm-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--theme-border);
    border-top: 3px solid var(--theme-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.llm-loading-text {
    font-size: 0.9em;
    font-style: italic;
}

/* === Success and Error States === */
.llm-success-message,
.llm-error-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    animation: slideInDown 0.3s ease-out;
}

.llm-success-message {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.llm-error-message {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Enhanced Refresh Button Animation === */
.llm-refresh-topics-btn.refreshing {
    animation: continuousRotate 1s linear infinite;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}
.llm-temp-status {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    max-width: 300px;
    font-size: 0.9em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
@keyframes continuousRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
/* === Responsive Design === */
@media (max-width: 768px) {
    .llm-temp-status {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    .llm-related-topics-area {
        padding: 12px 15px;
    }

    .llm-related-topics-area h4 {
        font-size: 1em;
    }

    .llm-related-topic-tag {
        font-size: 0.8em;
        padding: 6px 10px;
    }
    .llm-topic-tag {
        min-width: 180px;
        max-width: 100%;
        padding: 10px 12px;
    }

    .llm-topic-title {
        font-size: 0.95em;
    }

    .llm-topic-meta {
        font-size: 0.7em;
    }
    .llm-topics-header h3 {
        font-size: 1.1em;
    }

    .llm-refresh-topics-btn {
        width: 36px;
        height: 36px;
    }
    .llm-container {
        height: calc(100vh - var(--header-height) - 1rem);
    }

    .llm-user-input-area {
        flex-direction: column;
        gap: 12px;
        padding: 12px 15px;
    }

    .llm-input-controls {
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
    }

    .llm-control-btn {
        min-width: 80px;
        height: 44px;
        font-size: 0.85em;
    }

    .llm-user-input-area textarea {
        width: 100%;
        min-height: 44px;
        font-size: 16px;
        padding: 12px 15px;
    }

    .llm-send-btn {
        width: 100%;
        height: 44px;
        font-size: 1em;
        font-weight: 600;
    }

    .llm-topics-grid {
        justify-content: center;
    }

    .llm-topic-tag {
        font-size: 0.85em;
        padding: 8px 12px;
    }

    .llm-modal-content {
        width: 95%;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .llm-topics-grid {
        gap: 12px;
    }

    .llm-topic-tag {
        min-width: 160px;
        padding: 8px 10px;
    }

    .llm-topic-title {
        font-size: 0.9em;
    }
    .llm-scrollable-content {
        padding: 15px;
    }

    .llm-user-input-area {
        padding: 10px 12px;
        gap: 10px;
    }

    .llm-user-input-area textarea {
        font-size: 16px;
        padding: 10px 12px;
        min-height: 48px;
    }

    .llm-send-btn {
        height: 48px;
        border-radius: 8px;
    }

    .llm-control-btn {
        height: 48px;
        padding: 8px 10px;
        font-size: 0.8em;
    }
}

/* === Landscape Mobile Optimization === */
@media (max-width: 768px) and (orientation: landscape) {
    .llm-user-input-area {
        flex-direction: row;
        padding: 8px 15px;
    }

    .llm-input-controls {
        flex-direction: column;
        width: auto;
        min-width: 100px;
    }

    .llm-send-btn {
        width: auto;
        min-width: 80px;
    }
}