.pg-scope .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.pg-scope .glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    box-shadow: var(--shadow-glass);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.pg-scope .glass.tool-header {
    background: linear-gradient(135deg, #7c5cff, #5b3fd9);
}

[data-theme="dark"] .pg-scope .glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pg-scope .glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.pg-scope .tool-header {
    text-align: center;
    padding: 3rem 2rem 2rem;
    color: var(--text-primary);
    background: var(--bg-container);
    position: relative;
}

.pg-scope .title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
    text-shadow: none;
}

.pg-scope .subtitle {
    font-size: 1.2rem;
    opacity: 0.7;
    font-weight: 300;
    color: white;
}

/* Educational Section */
.pg-scope .react-explanation {
    background: var(--bg-container);
    padding: 2rem;
    border-radius: 24px;
}

.pg-scope .section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pg-scope .concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.pg-scope .concept-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.pg-scope .concept-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.pg-scope .concept-card[data-concept="reasoning"]:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
}

.pg-scope .concept-card[data-concept="acting"]:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.pg-scope .concept-card[data-concept="observation"]:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.pg-scope .concept-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pg-scope .concept-icon {
    font-size: 1.5rem;
}

.pg-scope .concept-header h4 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.pg-scope .concept-description {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.pg-scope .concept-visual {
    margin: 0.8rem 0;
    padding: 0.5rem 0.75rem;
    background: var(--bg-subtle);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-left: 3px solid var(--accent-primary);
}

.pg-scope .concept-example {
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.9rem;
}

/* ReAct Flow Diagram */
.pg-scope .react-flow-diagram {
    background: var(--bg-subtle);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.pg-scope .react-flow-diagram h4 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.pg-scope .flow-steps {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pg-scope .flow-step {
    background: var(--bg-container);
    border: 2px solid var(--accent-primary);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    min-width: 150px;
    text-align: center;
    transition: all 0.3s ease;
}

.pg-scope .flow-step:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.pg-scope .flow-number {
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 0.5rem;
}

.pg-scope .flow-content {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.pg-scope .flow-content strong {
    display: block;
    margin-bottom: 0.25rem;
}

.pg-scope .flow-arrow {
    font-size: 1.5rem;
    color: var(--accent-primary);
    font-weight: 700;
}

/* Main Content */
.pg-scope .main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    padding: 2rem;
    background: var(--bg-container);
}

.pg-scope .control-panel, .pg-scope .execution-panel {
    padding: 2rem;
}

.pg-scope .panel-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pg-scope .icon {
    width: 24px;
    height: 24px;
    opacity: 0.8;
    color: var(--text-secondary);
}

/* Task Selection */
.pg-scope .task-selection {
    margin-bottom: 1.5rem;
}

.pg-scope .task-selection label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.pg-scope .task-select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pg-scope .task-select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
}

.pg-scope .task-select option {
    background: var(--bg-container);
    color: var(--text-primary);
}

/* Custom Task Input */
.pg-scope .custom-task-input {
    margin-bottom: 1.5rem;
}

.pg-scope .custom-task-input label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.pg-scope .custom-task-textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.pg-scope .custom-task-textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
}

/* Available Tools */
.pg-scope .available-tools {
    margin-bottom: 1.5rem;
}

.pg-scope .available-tools h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.pg-scope .tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.pg-scope .tool-badge {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pg-scope .tool-badge:hover {
    background: var(--bg-subtle);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.pg-scope .tool-badge.active {
    border-color: var(--accent-primary);
    background: rgba(124, 92, 255, 0.1);
}

.pg-scope .tool-icon {
    font-size: 1.2rem;
}

.pg-scope .tool-badge span:last-child {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Action Buttons */
.pg-scope .action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pg-scope .run-btn, .pg-scope .reset-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.pg-scope .run-btn {
    background: linear-gradient(135deg, var(--accent-primary), #5b3fd9);
    color: white;
}

.pg-scope .run-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(124, 92, 255, 0.3);
}

.pg-scope .run-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pg-scope .reset-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.pg-scope .reset-btn:hover {
    background: var(--bg-subtle);
}

.pg-scope .btn-icon {
    font-size: 1rem;
}

/* Agent Stats */
.pg-scope .agent-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.pg-scope .stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.pg-scope .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.pg-scope .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Execution Panel */
.pg-scope .trace-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.pg-scope .empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.pg-scope .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.pg-scope .empty-text {
    font-style: italic;
}

/* Trace Steps */
.pg-scope .trace-step {
    background: var(--bg-container);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-primary);
    animation: slideIn 0.5s ease;
}

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

.pg-scope .trace-step.thought {
    border-left-color: #8b5cf6;
}

.pg-scope .trace-step.action {
    border-left-color: #3b82f6;
}

.pg-scope .trace-step.observation {
    border-left-color: #10b981;
}

.pg-scope .trace-step.answer {
    border-left-color: var(--accent-success);
    background: rgba(16, 185, 129, 0.05);
}

.pg-scope .step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pg-scope .step-icon {
    font-size: 1.5rem;
}

.pg-scope .step-type {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pg-scope .step-number {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pg-scope .step-content {
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 2.25rem;
}

.pg-scope .tool-call {
    background: var(--bg-subtle);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.pg-scope .tool-name {
    color: var(--accent-primary);
    font-weight: 700;
}

.pg-scope .tool-params {
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Final Answer */
.pg-scope .final-answer {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border: 2px solid var(--accent-success);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 1.5rem;
}

.pg-scope .final-answer h3 {
    color: var(--accent-success);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.pg-scope .answer-content {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 1rem;
}

/* Loading Animation */
.pg-scope .loading-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 1rem;
}

.pg-scope .loading-dots {
    display: flex;
    gap: 0.25rem;
}

.pg-scope .loading-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.pg-scope .loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.pg-scope .loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Floating Particles */
.pg-scope .floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.pg-scope .particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10px) rotate(360deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 968px) {
    .pg-scope .main-content {
        grid-template-columns: 1fr;
    }

    .pg-scope .control-panel {
        order: 1;
    }

    .pg-scope .execution-panel {
        order: 2;
    }

    .pg-scope .flow-steps {
        flex-direction: column;
    }

    .pg-scope .flow-arrow {
        transform: rotate(90deg);
    }

    .pg-scope .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .pg-scope .container {
        padding: 1rem;
    }

    .pg-scope .tool-header {
        padding: 4rem 2rem 2rem;
    }

    .pg-scope .concept-grid {
        grid-template-columns: 1fr;
    }

    .pg-scope .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pg-scope .agent-stats {
        grid-template-columns: 1fr;
    }

    .pg-scope .action-buttons {
        flex-direction: column;
    }
}