/* Process Guide Sidebar Styles */

.process-guide-sidebar {
    position: fixed;
    right: 20px;
    top: 100px;
    width: 280px;
    max-height: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-family: inherit;
    transition: box-shadow 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

/* Resize Handle - Left edge for horizontal resize, bottom-left corner for both */
.pg-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: ew-resize;
    background: transparent;
    z-index: 10;
    transition: background 0.2s;
}

.pg-resize-handle::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 40px;
    background: #ddd;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.pg-resize-handle:hover::before,
.process-guide-sidebar.pg-resizing .pg-resize-handle::before {
    opacity: 1;
    background: #667eea;
}

.process-guide-sidebar.pg-resizing {
    transition: none;
    box-shadow: 0 4px 30px rgba(102, 126, 234, 0.3);
}

.process-guide-sidebar.pg-resizing .pg-resize-handle {
    background: rgba(102, 126, 234, 0.1);
}

.process-guide-sidebar.minimized {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
}

.process-guide-sidebar.minimized .pg-resize-handle {
    display: none;
}

.process-guide-sidebar.pg-disabled-state {
    opacity: 0.6;
}

/* Header */
.pg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
}

.pg-title {
    font-weight: 600;
    color: white;
    font-size: 14px;
}

.pg-controls {
    display: flex;
    gap: 8px;
}

.pg-minimize,
.pg-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 12px;
    cursor: pointer;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.pg-minimize:hover,
.pg-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pg-toggle.pg-disabled {
    background: rgba(0, 0, 0, 0.2);
}

/* Messages Container */
.pg-messages {
    padding: 12px;
    max-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Individual Message */
.pg-message {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #f0f7ff;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    animation: slideIn 0.3s ease;
}

.pg-message:last-child {
    margin-bottom: 0;
}

.pg-message.pg-welcome {
    background: #f8f9fa;
    border-left-color: #999;
}

.pg-message.pg-loading {
    background: #fff9e6;
    border-left-color: #f5a623;
}

.pg-message.pg-loading .pg-text {
    color: #666;
    font-style: italic;
}

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

.pg-text {
    display: block;
    color: #333;
    line-height: 1.4;
    font-size: 13px;
}

.pg-time {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* Minimized Icon */
.pg-minimized-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #667eea;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 100%);
    border-radius: 50%;
}

/* Scrollbar styling */
.pg-messages::-webkit-scrollbar {
    width: 6px;
}

.pg-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.pg-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.pg-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* User Message Styling */
.pg-message.user {
    background: #e8f5e9;
    border-left: none;
    border-right: 3px solid #4caf50;
    margin-left: 20px;
    text-align: right;
}

.pg-message.user .pg-text {
    color: #2e7d32;
}

.pg-message.user .pg-time {
    text-align: right;
}

/* Assistant Message Styling */
.pg-message.assistant {
    background: #f0f7ff;
    border-left: 3px solid #667eea;
    border-right: none;
    margin-right: 20px;
}

/* Chat Input Container */
.pg-chat-input-container {
    display: flex;
    padding: 10px 12px;
    gap: 8px;
    border-top: 1px solid #eee;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

/* Chat Input Field */
.pg-chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
}

.pg-chat-input:focus {
    border-color: #667eea;
}

.pg-chat-input::placeholder {
    color: #aaa;
}

.pg-chat-input:disabled,
.pg-chat-input.pg-chat-input-disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

/* Send Button */
.pg-chat-send-btn {
    padding: 8px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
}

.pg-chat-send-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: scale(1.02);
}

.pg-chat-send-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.pg-chat-send-btn:disabled,
.pg-chat-send-btn.pg-chat-send-btn-disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .process-guide-sidebar {
        right: 10px;
        top: 80px;
        width: 260px;
    }

    .process-guide-sidebar.minimized {
        width: 44px;
        height: 44px;
    }

    .pg-chat-input-container {
        padding: 8px 10px;
    }

    .pg-chat-input {
        padding: 6px 10px;
        font-size: 12px;
    }

    .pg-chat-send-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* ===== Visualization Toggle Button ===== */
.pg-viz-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    cursor: pointer;
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.pg-viz-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.pg-viz-toggle:active {
    transform: scale(0.95);
}

.pg-viz-toggle--active {
    background: rgba(124, 58, 237, 0.7);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
}

.pg-viz-toggle--active:hover {
    background: rgba(124, 58, 237, 0.85);
}

/* Visualization container positioning */
.arch-viz-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 950;
}

@media (max-width: 768px) {
    .arch-viz-container {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
}

/* Dragging state */
.pg-dragging {
    opacity: 0.9;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.pg-header {
    cursor: move;
}

