/* WIA Standards AI Assistant v2.0 */

.wia-ai-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #00d4ff, #7b2cbf);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.wia-ai-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.6);
}

.wia-ai-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.wia-ai-overlay.show { display: flex; }

.wia-ai-modal {
    width: 520px;
    max-width: 95vw;
    max-height: 95vh;
    min-width: 320px;
    background: #1a1a2e;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #30363d;
    position: relative;
}

.wia-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: ew-resize;
    z-index: 10;
}

.wia-resize-handle:hover { background: rgba(0, 212, 255, 0.3); }
.wia-resize-handle.left { left: -4px; border-radius: 16px 0 0 16px; }
.wia-resize-handle.right { right: -4px; border-radius: 0 16px 16px 0; }

.wia-ai-header {
    background: linear-gradient(135deg, #00d4ff 0%, #7b2cbf 100%);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    user-select: none;
}

.wia-ai-header:active { cursor: grabbing; }
.wia-ai-header h3 { margin: 0; font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; }

.wia-ai-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}

.wia-ai-close:hover { background: rgba(255,255,255,0.3); }

.wia-ai-tabs {
    display: flex;
    background: #16213e;
    border-bottom: 1px solid #30363d;
}

.wia-ai-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.wia-ai-tab:hover { background: rgba(0, 212, 255, 0.1); color: #00d4ff; }
.wia-ai-tab.active { background: rgba(0, 212, 255, 0.15); color: #00d4ff; border-bottom: 2px solid #00d4ff; }
.wia-ai-tab .badge { background: #10b981; color: white; padding: 2px 8px; border-radius: 10px; font-size: 11px; margin-left: 5px; }

.wia-ai-api-section {
    display: flex;
    gap: 10px;
    padding: 12px 15px;
    background: #16213e;
    border-bottom: 1px solid #30363d;
    align-items: center;
}

.wia-ai-api-section input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #30363d;
    border-radius: 8px;
    font-size: 13px;
    background: #0a0a0f;
    color: white;
}

.wia-ai-api-section input:focus { border-color: #00d4ff; outline: none; }

.wia-save-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #00d4ff, #7b2cbf);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.wia-get-key { color: #00d4ff; text-decoration: none; font-size: 13px; white-space: nowrap; }
.wia-get-key:hover { text-decoration: underline; }

/* Collapsible Sections */
.wia-collapsible { border-bottom: 1px solid #30363d; }

.wia-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(123,44,191,0.1));
    cursor: pointer;
    color: #00d4ff;
    font-weight: 500;
}

.wia-section-header:hover { background: rgba(0, 212, 255, 0.15); }
.wia-toggle-icon { font-size: 12px; transition: transform 0.3s; color: #888; }

.wia-section-content {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 10px 15px;
    background: #0a0a0f;
}

.wia-collapsible.collapsed .wia-section-content { max-height: 0; padding: 0 15px; }

.wia-tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wia-tool-btn {
    padding: 8px 14px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid #30363d;
    border-radius: 20px;
    color: #e0e0e0;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.wia-tool-btn:hover { background: rgba(0, 212, 255, 0.2); border-color: #00d4ff; color: #00d4ff; }

.wia-ai-body {
    flex: 1;
    overflow-y: auto;
    background: #0a0a0f;
}

.wia-chat-area {
    min-height: 280px;
    max-height: 350px;
    overflow-y: auto;
    padding: 15px;
}

.wia-message { margin-bottom: 15px; display: flex; gap: 10px; }
.wia-message.user { justify-content: flex-end; }

.wia-message-content {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.wia-message.assistant .wia-message-content { background: #1a1a2e; color: #e0e0e0; border: 1px solid #30363d; }
.wia-message.user .wia-message-content { background: linear-gradient(135deg, #00d4ff, #7b2cbf); color: white; }
.wia-message-content a { color: #00d4ff; text-decoration: none; }
.wia-message-content a:hover { text-decoration: underline; }

.wia-input-area {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #1a1a2e;
    border-top: 1px solid #30363d;
}

.wia-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #30363d;
    border-radius: 25px;
    font-size: 14px;
    background: #0a0a0f;
    color: white;
}

.wia-input-area input:focus { border-color: #00d4ff; outline: none; }
.wia-input-area input::placeholder { color: #666; }

.wia-send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff, #7b2cbf);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.3s;
}

.wia-send-btn:hover { transform: scale(1.1); }

.wia-welcome { text-align: center; padding: 30px 20px; }
.wia-welcome-icon { font-size: 50px; margin-bottom: 15px; }
.wia-welcome h4 { color: #00d4ff; margin-bottom: 10px; font-size: 18px; }
.wia-welcome p { color: #888; font-size: 14px; }

/* Mobile */
@media (max-width: 768px) {
    .wia-ai-fab { bottom: 20px; right: 20px; padding: 12px 20px; font-size: 14px; }
    .wia-ai-modal { width: 95% !important; max-height: 90vh !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; }
    .wia-ai-header { cursor: default; }
    .wia-ai-api-section { flex-wrap: wrap; }
    .wia-ai-api-section input { min-width: 100%; }
}
