/* Agent Platform 2.0 Premium Styling */

/* Tabs in Right Sidebar */
.right-sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
}

.right-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.6;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.right-tab:hover, .right-tab.active {
    opacity: 1;
    color: var(--md-sys-color-primary);
}

.right-tab.active {
    border-bottom-color: var(--md-sys-color-primary);
    background: rgba(255, 255, 255, 0.01);
}

.right-tab-content {
    display: none;
    height: calc(100vh - 40px);
    overflow-y: auto;
}

.right-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Chat Layout Fixes & Upgrades */
#ai-chat-history {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-3);
}

.chat-msg {
    max-width: 95% !important;
    animation: fadeInMsg 0.25s ease-out;
}

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

.chat-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--md-sys-color-primary), #007acc) !important;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.2);
}

.chat-msg.ai {
    align-self: flex-start;
    background: var(--md-sys-color-surface-hover) !important;
    border: 1px solid var(--md-sys-color-outline-variant);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Quick Prompt Chips */
.prompt-chip {
    flex-shrink: 0;
    font-size: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface-variant);
    padding: 4px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.prompt-chip:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-primary);
}

/* Revamped Anti-Gravity 2.0 Chat Styles */

.agent-header-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 6px;
    margin-bottom: 8px;
}

.agent-status-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-avatar-glow {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 230, 118, 0.1);
}

.agent-status-pulse {
    width: 8px;
    height: 8px;
    background: #00e676;
    border-radius: 50%;
    box-shadow: 0 0 8px #00e676;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(0, 230, 118, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0);
    }
}

.agent-title-meta {
    display: flex;
    flex-direction: column;
}

.agent-name {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

.agent-desc {
    font-size: 9px;
    opacity: 0.55;
    color: var(--md-sys-color-on-surface-variant);
}

.agent-status-right {
    display: flex;
    gap: 6px;
}

.status-tag {
    font-size: 8.5px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-tag.model-badge {
    background: rgba(186, 104, 200, 0.15);
    color: #ba68c8;
}

.status-tag.search-badge {
    background: rgba(76, 175, 80, 0.15);
    color: #81c784;
}

/* Chat structure flex alignment */
#ai-chat-history .chat-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 12px !important;
    border-radius: 8px;
    max-width: 95% !important;
    margin-bottom: 4px;
}

#ai-chat-history .chat-msg.user {
    margin-left: auto;
    flex-direction: row-reverse;
    background: linear-gradient(135deg, var(--md-sys-color-primary), #0288d1) !important;
}

#ai-chat-history .chat-msg.ai {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.msg-avatar-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-primary);
    flex-shrink: 0;
}

.chat-msg.user .msg-avatar-icon {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.msg-avatar-icon svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.msg-bubble-content {
    flex: 1;
    overflow: hidden;
}

.msg-meta-header {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 4px;
}

/* Premium Textarea Input Container */
.agent-input-container {
    border: 1px solid var(--md-sys-color-outline-variant);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: border-color 0.2s, background 0.2s;
}

.agent-input-container:focus-within {
    border-color: var(--md-sys-color-primary);
    background: rgba(255, 255, 255, 0.05);
}

.agent-input-container textarea {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    resize: none;
    font-size: 11.5px;
    height: 52px;
    color: var(--md-sys-color-on-surface);
    padding: 0;
    line-height: 1.4;
    font-family: inherit;
}

.agent-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 6px;
}

.context-tags {
    display: flex;
    gap: 6px;
}

.context-tag {
    font-size: 9px;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 4px;
}

.context-tag svg {
    width: 10px;
    height: 10px;
    fill: currentColor;
}

.agent-send-btn {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
    padding: 0;
}

.agent-send-btn:hover {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.agent-send-btn:active {
    transform: scale(0.95);
}

.agent-send-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    transform: translate(1px, 0);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
