/* LLM Platform Chat Interface Styles */

/* Base Styles */
.llm-chat-container {
    display: flex;
    flex-direction: row;
    height: 100%;
    background: #000000;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* Sidebar Styles - LEFT SIDE */
.llm-sidebar {
    width: 320px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-right: 1px solid #333333;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.llm-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(0, 255, 255, 0.03) 50%, transparent 70%);
    pointer-events: none;
    animation: shimmer 3s ease-in-out infinite;
}

.llm-sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid #333333;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.llm-sidebar-header .llm-provider-info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.llm-sidebar-header .llm-provider-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    border: none !important;
}

.llm-sidebar-header .llm-provider-logo svg {
    background: transparent !important;
}

.llm-sidebar-header .llm-provider-logo * {
    background: transparent !important;
}

.llm-sidebar-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.llm-sidebar-header .llm-provider-description {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: #888888;
}

.llm-new-chat-btn {
    width: 100%;
    background: linear-gradient(135deg, #00ffff 0%, #0080ff 100%);
    border: none;
    color: #000000;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    text-shadow: none;
}

.llm-new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    background: linear-gradient(135deg, #00ffff 0%, #00aaff 100%);
}

/* Chat History Title */
.llm-chat-history-title {
    padding: 16px 24px 8px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #333333;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.llm-conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    position: relative;
    z-index: 1;
}

.llm-conversations-list::-webkit-scrollbar {
    width: 4px;
}

.llm-conversations-list::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.llm-conversations-list::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: 2px;
}

.llm-conversations-list::-webkit-scrollbar-thumb:hover {
    background: #00aaff;
}

.llm-conversation-item {
    padding: 14px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.llm-conversation-item:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: rgba(0, 255, 255, 0.3);
    transform: translateX(4px);
}

.llm-conversation-item.active {
    background: rgba(0, 255, 255, 0.15);
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.llm-conversation-content {
    flex: 1;
    min-width: 0;
}

.llm-conversation-title {
    font-size: 12px !important;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

/* Additional specific rule to ensure font size is applied */
.llm-conversations-list .llm-conversation-item .llm-conversation-title {
    font-size: 12px !important;
}

.llm-conversation-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #888888;
    gap: 8px;
}

.llm-conversation-date {
    white-space: nowrap;
}

.llm-conversation-model {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Delete Button */
.llm-conversation-delete {
    opacity: 0;
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #ff6666;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 8px;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.llm-conversation-delete:hover {
    background: rgba(255, 0, 0, 0.4);
    border-color: rgba(255, 0, 0, 0.6);
    color: #ffffff;
    transform: scale(1.1);
}

.llm-conversation-item:hover .llm-conversation-delete {
    opacity: 1;
}

.llm-conversation-delete svg {
    width: 12px;
    height: 12px;
}

/* Main Chat Area - RIGHT SIDE */
.llm-main-chat-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background: #000000;
    position: relative;
}

.llm-main-chat-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(0, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 128, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Header Styles */
.llm-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-bottom: 1px solid #333333;
    min-height: 80px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.llm-chat-header-left {
    display: flex;
    align-items: center;
}

.llm-provider-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.llm-provider-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    border: none !important;
}

.llm-provider-logo svg {
    background: transparent !important;
}

.llm-provider-logo * {
    background: transparent !important;
}

.llm-provider-info h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.llm-provider-description {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: #888888;
}

.llm-chat-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.llm-usage-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.llm-messages-left {
    font-size: 12px;
    font-weight: 500;
}

.llm-unlimited {
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.llm-limited {
    color: #ffaa00;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

.llm-subscription-tier {
    font-size: 11px;
    color: #ffffff;
    background: linear-gradient(135deg, #00ffff 0%, #0080ff 100%);
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.llm-model-selector select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333333;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.llm-model-selector select:hover {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.llm-model-selector select:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

/* Chat Area Styles */
.llm-chat-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.llm-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
}

.llm-messages-container::-webkit-scrollbar {
    width: 6px;
}

.llm-messages-container::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.llm-messages-container::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: 3px;
}

.llm-messages-container::-webkit-scrollbar-thumb:hover {
    background: #00aaff;
}

/* Welcome Message */
.llm-welcome-message {
    text-align: center;
    padding: 40px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.llm-welcome-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #00ffff 0%, #0080ff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

.llm-welcome-message h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 16px 0;
    background: linear-gradient(135deg, #00ffff 0%, #0080ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.llm-welcome-message p {
    font-size: 14px;
    color: #888888;
    margin: 0 0 32px 0;
    line-height: 1.6;
}

.llm-suggestions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.llm-suggestion-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333333;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    backdrop-filter: blur(10px);
}

.llm-suggestion-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: #00ffff;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

/* Welcome screen with sample prompts */
.llm-welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
    text-align: center;
}

.llm-welcome-header {
    margin-bottom: 40px;
}

.llm-welcome-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sample prompts */
.llm-sample-prompts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 800px;
    width: 100%;
}

.llm-prompt-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
}

.llm-prompt-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.2);
}

.llm-prompt-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.llm-prompt-icon svg {
    width: 20px;
    height: 20px;
    color: #000000;
}

.llm-prompt-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 4px 0;
}

.llm-prompt-content p {
    font-size: 14px;
    color: #a0aec0;
    margin: 0;
    line-height: 1.4;
}

/* Typing indicator for AI messages */
.llm-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
}

.llm-typing-dot {
    width: 4px;
    height: 4px;
    background-color: currentColor;
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
    opacity: 0.6;
}

.llm-typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.llm-typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.llm-typing-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typingDot {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Message Styles */
.llm-message {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    animation: fadeInUp 0.3s ease;
    position: relative;
}

.llm-message-user {
    flex-direction: row-reverse;
}

.llm-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.llm-message-avatar img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 50%;
}

.llm-message-avatar svg {
    width: 16px;
    height: 16px;
    color: #ffffff;
}

.llm-message-avatar.user {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #000000;
}

.llm-message-avatar.assistant {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: #ffffff;
}

.llm-message-content {
    flex: 1;
    max-width: calc(100% - 44px);
    position: relative;
}

.llm-thinking-message .llm-message-content {
    max-width: 100%;
}

.llm-message-user .llm-message-content {
    text-align: right;
}

.llm-message-bubble {
    display: inline-block;
    padding: 14px 18px;
    border-radius: 20px;
    max-width: 100%;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 14px;
    will-change: contents;
    white-space: pre-wrap;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* User message bubble with tail */
.llm-message-user .llm-message-bubble {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #000000;
    border-bottom-right-radius: 6px;
}

.llm-message-user .llm-message-bubble::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid #0099cc;
    border-bottom: 8px solid transparent;
}

/* AI message bubble with tail */
.llm-message-assistant .llm-message-bubble {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #ffffff;
    border-bottom-left-radius: 6px;
}

.llm-message-assistant .llm-message-bubble::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-right: 8px solid #1a202c;
    border-bottom: 8px solid transparent;
}

/* Optimize streaming messages for better performance */
.llm-message-streaming .llm-message-bubble {
    will-change: contents;
    transform: translateZ(0);
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #ffffff;
    border-bottom-left-radius: 6px;
}

.llm-message-streaming .llm-message-bubble::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-right: 8px solid #1a202c;
    border-bottom: 8px solid transparent;
}

.llm-message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 11px;
    color: #a0aec0;
}

.llm-message-user .llm-message-meta {
    justify-content: flex-end;
}

.llm-message-time {
    font-size: 11px;
    color: #a0aec0;
}

.llm-message-tokens {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    color: #a0aec0;
}

/* Input Area Styles */
.llm-input-area {
    padding: 20px 24px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-top: 1px solid #333333;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.llm-chat-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.llm-input-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333333;
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.llm-input-container:focus-within {
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

#llm-message-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 12px;
    line-height: 1.5;
    resize: none;
    outline: none;
    min-height: 20px;
    max-height: 120px;
}

#llm-message-input::placeholder {
    color: #888888;
}

.llm-send-btn {
    background: linear-gradient(135deg, #00ffff 0%, #0080ff 100%);
    border: none;
    color: #000000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.llm-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.5);
}

.llm-send-btn:disabled {
    background: #333333;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.llm-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #888888;
}

.llm-input-info {
    display: flex;
    gap: 16px;
}

.llm-char-count {
    font-family: monospace;
    color: #00ffff;
}

.llm-model-info {
    display: flex;
    align-items: center;
    gap: 4px;
}

.llm-login-prompt {
    text-align: center;
}

.llm-login-link {
    color: #00ffff;
    text-decoration: none;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.llm-login-link:hover {
    text-decoration: underline;
}

/* Loading States */
.llm-loading-messages {
    text-align: center;
    padding: 40px 20px;
    color: #888888;
}

.llm-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #333333;
    border-top: 3px solid #00ffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.llm-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.llm-loading-content {
    text-align: center;
    color: #ffffff;
}

.llm-typing-indicator {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-bottom: 16px;
}

.llm-typing-dot {
    width: 8px;
    height: 8px;
    background: #00ffff;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.llm-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.llm-typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* Typing indicator message styles */
.llm-typing-indicator-message {
    opacity: 1;
    animation: fadeInUp 0.3s ease-out;
}

.llm-typing-indicator-message .llm-message-bubble {
    background: rgba(0, 255, 255, 0.15);
    border: 1px solid rgba(0, 255, 255, 0.3);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 20px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.llm-typing-indicator-message .llm-typing-indicator {
    margin: 0;
    justify-content: flex-start;
}

.llm-typing-indicator-message .llm-typing-dot {
    width: 10px;
    height: 10px;
    background: #00ffff;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    margin: 0 2px;
}

/* Advanced Hi-Tech Thinking Animation - Modal Style */
.llm-thinking-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.3s ease-out;
}

.llm-thinking-content {
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.95) 0%, rgba(0, 40, 80, 0.95) 100%);
    border: 2px solid rgba(0, 255, 255, 0.8);
    min-height: 350px;
    min-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    box-shadow: 
        0 0 80px rgba(0, 255, 255, 0.5),
        inset 0 0 80px rgba(0, 255, 255, 0.1);
    border-radius: 32px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

/* Animated Background */
.llm-thinking-message .llm-message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 30%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(0, 128, 255, 0.1) 0%, transparent 50%);
    animation: backgroundPulse 4s ease-in-out infinite;
}

.llm-thinking-message .llm-message-bubble::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.2), transparent);
    animation: scanLine 3s ease-in-out infinite;
}

/* Digital Glowing Text */
.llm-thinking-text {
    font-size: 38px;
    font-weight: 700;
    font-family: 'Poppins', 'Arial', sans-serif;
    color: #00ffff;
    text-shadow: 
        0 0 15px rgba(0, 255, 255, 0.9),
        0 0 25px rgba(0, 255, 255, 0.7),
        0 0 35px rgba(0, 255, 255, 0.5);
    letter-spacing: 4px;
    animation: advancedTextGlow 2s ease-in-out infinite;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    width: 100%;
    display: block;
    margin: 0 auto 40px auto;
}

/* Advanced Typing Dots */
.llm-simple-typing {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
    width: 100%;
    margin: 0 auto;
}

.llm-simple-dot {
    width: 10px;
    height: 10px;
    background: #00ffff;
    border-radius: 50%;
    animation: advancedDotPulse 1.4s infinite ease-in-out;
    box-shadow: 
        0 0 15px rgba(0, 255, 255, 0.8),
        0 0 25px rgba(0, 255, 255, 0.4);
    position: relative;
}

.llm-simple-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(0, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: dotRipple 2s ease-out infinite;
}

.llm-simple-dot:nth-child(1) { animation-delay: -0.32s; }
.llm-simple-dot:nth-child(2) { animation-delay: -0.16s; }

/* Particle Network */
.llm-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.llm-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00ffff;
    border-radius: 50%;
    animation: particlePulse 3s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

/* Particle positions - creating a network pattern */
.llm-particle:nth-child(1) { left: 15%; top: 25%; animation-delay: 0s; }
.llm-particle:nth-child(2) { left: 85%; top: 20%; animation-delay: 0.5s; }
.llm-particle:nth-child(3) { left: 45%; top: 75%; animation-delay: 1s; }
.llm-particle:nth-child(4) { left: 65%; top: 65%; animation-delay: 1.5s; }
.llm-particle:nth-child(5) { left: 25%; top: 45%; animation-delay: 2s; }
.llm-particle:nth-child(6) { left: 75%; top: 85%; animation-delay: 2.5s; }
.llm-particle:nth-child(7) { left: 35%; top: 15%; animation-delay: 0.3s; }
.llm-particle:nth-child(8) { left: 55%; top: 35%; animation-delay: 0.8s; }
.llm-particle:nth-child(9) { left: 20%; top: 70%; animation-delay: 1.2s; }
.llm-particle:nth-child(10) { left: 80%; top: 50%; animation-delay: 1.7s; }
.llm-particle:nth-child(11) { left: 40%; top: 85%; animation-delay: 2.2s; }
.llm-particle:nth-child(12) { left: 70%; top: 30%; animation-delay: 2.7s; }

/* Particle Connections - Lines between particles */
.llm-particle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.6), transparent);
    transform: translate(-50%, -50%);
    animation: connectionPulse 4s ease-in-out infinite;
}

.llm-particle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 40px;
    background: linear-gradient(180deg, rgba(0, 255, 255, 0.6), transparent);
    transform: translate(-50%, -50%);
    animation: connectionPulse 4s ease-in-out infinite;
    animation-delay: 2s;
}



/* Modal Styles */
.llm-error-modal,
.llm-upgrade-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    backdrop-filter: blur(15px);
    animation: fadeInUp 0.3s ease-out;
    pointer-events: auto;
}

.llm-error-content,
.llm-upgrade-content {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    padding: 40px;
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.3);
    position: relative;
    animation: fadeInUp 0.3s ease-out;
    z-index: 1000000;
}

.llm-error-icon,
.llm-upgrade-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #ff0000 0%, #800000 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

.llm-upgrade-icon {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}

.llm-upgrade-header {
    margin-bottom: 32px;
}

.llm-error-content h3,
.llm-upgrade-content h3 {
    margin: 0 0 16px 0;
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #ffffff 0%, #00d4ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.llm-error-content p,
.llm-upgrade-content p {
    margin: 0 0 24px 0;
    color: #a0aec0;
    line-height: 1.6;
    font-size: 16px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.llm-error-close,
.llm-upgrade-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.llm-error-close:hover,
.llm-upgrade-close:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
}

/* Upgrade Plans */
.llm-upgrade-plans {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: center;
    align-items: stretch;
    overflow-x: auto;
    padding: 5px 0;
}

.llm-upgrade-plan {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    text-align: left;
    backdrop-filter: blur(10px);
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    min-width: 200px;
    flex: 1;
}

.llm-upgrade-plan::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00d4ff, #0099cc);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.llm-upgrade-plan:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3), 0 15px 40px rgba(0, 212, 255, 0.2);
}

.llm-upgrade-plan:hover::before {
    opacity: 1;
}

.llm-upgrade-plan.featured {
    border: 2px solid #00d4ff;
    background: rgba(0, 212, 255, 0.05);
    transform: scale(1.02);
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.4), 0 8px 32px rgba(0, 212, 255, 0.2);
}

.llm-upgrade-plan.featured::before {
    opacity: 1;
}

.llm-upgrade-plan.free-plan {
    border-color: rgba(160, 174, 192, 0.3);
    background: rgba(160, 174, 192, 0.05);
}

.llm-upgrade-plan.free-plan:hover {
    border-color: rgba(160, 174, 192, 0.5);
    box-shadow: 0 15px 40px rgba(160, 174, 192, 0.2);
}

.llm-plan-badge {
    position: absolute;
    top: 16px;
    right: -30px;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #000000;
    padding: 6px 40px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    transform: rotate(45deg);
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

.llm-upgrade-plan h4 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.llm-plan-price {
    font-size: 24px;
    font-weight: 800;
    color: #00d4ff;
    margin-bottom: 16px;
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.llm-plan-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.llm-plan-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #a0aec0;
}

.llm-plan-feature svg {
    color: #48bb78;
    flex-shrink: 0;
}

.llm-upgrade-btn {
    width: 100%;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border: none;
    color: #000000;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.llm-upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.llm-downgrade-btn {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%) !important;
    color: #ffffff !important;
}

.llm-downgrade-btn:hover {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%) !important;
    box-shadow: 0 8px 25px rgba(160, 174, 192, 0.4) !important;
}

.llm-upgrade-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.llm-upgrade-close,
.llm-pricing-redirect {
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-decoration: underline;
}

.llm-upgrade-close:hover,
.llm-pricing-redirect:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.llm-pricing-redirect {
    color: #00d4ff;
    font-weight: 600;
}

.llm-pricing-redirect:hover {
    color: #ffffff;
    background: rgba(0, 212, 255, 0.2);
}

/* Ensure modal appears above WordPress admin bar and other fixed elements */
#wpadminbar {
    z-index: 99999 !important;
}

/* Additional modal z-index override for any conflicting elements */
.llm-upgrade-modal,
.llm-error-modal {
    z-index: 999999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.8) !important;
    align-items: center !important;
    justify-content: center !important;
    backdrop-filter: blur(10px) !important;
}

/* Ensure upgrade modal can be shown */
.llm-upgrade-modal {
    display: none !important;
}

/* Keep error modal hidden */
.llm-error-modal {
    display: none !important;
}

.llm-upgrade-content,
.llm-error-content {
    z-index: 1000000 !important;
    max-width: 1200px !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    background: #1a1a1a !important;
    border-radius: 16px !important;
    padding: 24px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8) !important;
    border: 1px solid rgba(0, 212, 255, 0.3) !important;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.2), 0 20px 60px rgba(0, 0, 0, 0.8) !important;
}

/* Hide header and other elements when modal is active */
.llm-upgrade-modal ~ .llm-chat-header,
.llm-error-modal ~ .llm-chat-header {
    display: none !important;
}

/* Alternative approach: Lower z-index of all elements when modal is active */
.llm-upgrade-modal ~ *,
.llm-error-modal ~ * {
    z-index: 1 !important;
}

/* Specific header override when modal is active */
.llm-upgrade-modal ~ .llm-chat-header,
.llm-error-modal ~ .llm-chat-header,
.llm-upgrade-modal ~ .llm-sidebar,
.llm-error-modal ~ .llm-sidebar,
.llm-upgrade-modal ~ .llm-main-chat-area,
.llm-error-modal ~ .llm-main-chat-area {
    z-index: 1 !important;
    pointer-events: none !important;
}

/* Hide elements when modal is active using body class */
body.llm-modal-active .llm-chat-header,
body.llm-modal-active .llm-sidebar,
body.llm-modal-active .llm-main-chat-area,
body.llm-modal-active .llm-chat-container {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Alternative: Lower z-index when modal is active */
body.llm-modal-active .llm-chat-header,
body.llm-modal-active .llm-sidebar,
body.llm-modal-active .llm-main-chat-area,
body.llm-modal-active .llm-chat-container {
    z-index: -1 !important;
    pointer-events: none !important;
}

/* Force hide all elements when modal is active */
body.llm-modal-active *:not(.llm-upgrade-modal):not(.llm-upgrade-modal *):not(.llm-error-modal):not(.llm-error-modal *) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    z-index: -1 !important;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Advanced Animation Keyframes */
@keyframes advancedDotPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.6;
        box-shadow: 
            0 0 15px rgba(0, 255, 255, 0.8),
            0 0 25px rgba(0, 255, 255, 0.4);
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 
            0 0 20px rgba(0, 255, 255, 1),
            0 0 35px rgba(0, 255, 255, 0.6);
    }
}

@keyframes dotRipple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

@keyframes advancedTextGlow {
    0%, 100% { 
        text-shadow: 
            0 0 10px rgba(0, 255, 255, 0.8),
            0 0 20px rgba(0, 255, 255, 0.6),
            0 0 30px rgba(0, 255, 255, 0.4);
        transform: scale(1);
        opacity: 0.9;
    }
    50% { 
        text-shadow: 
            0 0 15px rgba(0, 255, 255, 1),
            0 0 25px rgba(0, 255, 255, 0.8),
            0 0 35px rgba(0, 255, 255, 0.6);
        transform: scale(1.05);
        opacity: 1;
    }
}

@keyframes backgroundPulse {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(1);
    }
    50% { 
        opacity: 0.6;
        transform: scale(1.1);
    }
}

@keyframes scanLine {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes particlePulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.8;
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    }
    50% { 
        transform: scale(1.3);
        opacity: 1;
        box-shadow: 0 0 20px rgba(0, 255, 255, 1);
    }
}

@keyframes connectionPulse {
    0%, 100% { 
        opacity: 0.3;
        transform: translate(-50%, -50%) scaleX(0.8);
    }
    50% { 
        opacity: 0.8;
        transform: translate(-50%, -50%) scaleX(1.2);
    }
}



/* Responsive Design */
@media (max-width: 768px) {
    .llm-chat-container {
        border-radius: 0;
        height: 100vh;
        flex-direction: column;
    }
    
    .llm-sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        width: 320px;
    }
    
    .llm-sidebar.open {
        left: 0;
    }
    
    .llm-main-chat-area {
        width: 100%;
    }
    
    .llm-chat-header {
        padding: 12px 16px;
        min-height: 60px;
    }
    
    .llm-provider-info h2 {
        font-size: 18px;
    }
    
    .llm-provider-description {
        display: none;
    }
    
    .llm-messages-container {
        padding: 16px;
    }
    
    .llm-input-area {
        padding: 16px;
    }
    
    .llm-upgrade-plans {
        flex-direction: column !important;
        gap: 16px;
        overflow-x: visible;
    }
    
    .llm-upgrade-plan {
        min-width: auto;
        max-width: none;
    }
    
    .llm-error-content,
    .llm-upgrade-content {
        padding: 24px;
        margin: 20px;
        max-height: calc(100vh - 40px);
        max-width: 500px;
    }
    
    .llm-upgrade-content h3 {
        font-size: 24px;
    }
    
    .llm-upgrade-content p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .llm-chat-header-right {
        flex-direction: column;
        gap: 8px;
        align-items: flex-end;
    }
    
    .llm-usage-info {
        align-items: flex-end;
    }
    
    .llm-model-selector select {
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .llm-welcome-message {
        padding: 40px 16px;
    }
    
    .llm-welcome-message h3 {
        font-size: 24px;
    }
    
    .llm-suggestions {
        max-width: 100%;
    }
    
    .llm-error-content,
    .llm-upgrade-content {
        padding: 20px;
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .llm-upgrade-plans {
        flex-direction: column !important;
        gap: 12px;
        overflow-x: visible;
    }
    
    .llm-upgrade-plan {
        padding: 16px;
        min-width: auto;
        max-width: none;
    }
    
    .llm-error-content,
    .llm-upgrade-content {
        max-width: 400px;
    }
    
    .llm-upgrade-content h3 {
        font-size: 20px;
    }
    
    .llm-upgrade-content p {
        font-size: 13px;
    }
    
    .llm-plan-price {
        font-size: 20px;
    }
    
    .llm-upgrade-plan h4 {
        font-size: 16px;
    }
}

/* Notification Styles */
.llm-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 10000;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease-out;
}

.llm-notification-success {
    background: #4CAF50;
    color: white;
}

.llm-notification-error {
    background: #f44336;
    color: white;
}

.llm-notification-info {
    background: #2196F3;
    color: white;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
} 