/* RAG Playground Specific Styles - Aligned with main theme */
.pg-scope .playground-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.pg-scope .playground-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 2rem;
    background: var(--gradient-primary);
    border-radius: 24px;
    color: white;
    position: relative;
    overflow: hidden;
}

.pg-scope .playground-header::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 .playground-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #fff, #e0e7ff);
    -webkit-background-clip: text;
    background-clip: text;
    font-weight: 700;
    color: white;
}

.pg-scope .playground-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

.pg-scope .workflow-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.pg-scope .step-card {
    background: var(--bg-container);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.pg-scope .step-card.active {
    border-color: var(--accent-primary);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 25px -5px rgba(124, 92, 255, 0.3);
}

.pg-scope .step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pg-scope .step-card.active::before {
    opacity: 1;
}

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

.pg-scope .step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.3rem;
    box-shadow: var(--shadow-medium);
}

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

.pg-scope .step-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.pg-scope .visual-container {
    min-height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    background: var(--bg-subtle);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.pg-scope .visual-container:hover {
    border-color: var(--accent-primary);
    background: rgba(124, 92, 255, 0.02);
}

.pg-scope .document-chunk {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.1) 0%, rgba(91, 63, 217, 0.1) 100%);
    border: 1px solid rgba(124, 92, 255, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin: 0.5rem;
    display: inline-block;
    max-width: 250px;
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.pg-scope .document-chunk:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(124, 92, 255, 0.15);
}

.pg-scope .embedding-vector {
    display: inline-flex;
    gap: 2px;
    margin: 0.25rem 0;
    justify-content: center;
}

.pg-scope .vector-value {
    width: 8px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 2px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.pg-scope .vector-value:hover {
    opacity: 1;
    transform: scaleY(1.2);
}

.pg-scope .controls {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.pg-scope .btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.pg-scope .btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-light);
}

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

.pg-scope .btn-secondary {
    background: var(--bg-container);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.pg-scope .btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
    background: white;
}

.pg-scope .query-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    font-size: 1rem;
    background: var(--bg-container);
    color: var(--text-primary);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.pg-scope .similarity-bar {
    height: 24px;
    background: var(--bg-subtle);
    border-radius: 12px;
    margin: 0.5rem 0;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.pg-scope .similarity-fill {
    height: 100%;
    background: var(--gradient-tertiary);
    border-radius: 12px;
    transition: width 0.8s ease;
    position: relative;
}

.pg-scope .similarity-score {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.pg-scope .response-box {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.05) 0%, rgba(0, 242, 254, 0.05) 100%);
    border: 2px solid rgba(79, 172, 254, 0.2);
    border-radius: 20px;
    padding: 2rem;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.pg-scope .response-box::before {
    content: '🤖';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    opacity: 0.7;
}

.pg-scope .typing-indicator {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    color: var(--text-secondary);
}

.pg-scope .typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: typing 1.5s infinite;
}

.pg-scope .typing-dot:nth-child(2) { animation-delay: 0.2s; }
.pg-scope .typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { opacity: 0.2; }
    30% { opacity: 1; }
}

.pg-scope .vector-db {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 0.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(253, 230, 138, 0.05) 100%);
    border-radius: 16px;
    border: 2px solid rgba(245, 158, 11, 0.2);
}

.pg-scope .vector-cell {
    aspect-ratio: 1;
    background: var(--bg-container);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pg-scope .vector-cell:hover {
    background: var(--gradient-secondary);
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-light);
}

.pg-scope .vector-cell.matched {
    background: var(--gradient-tertiary);
    color: white;
    animation: pulse 1.5s ease-in-out;
    box-shadow: var(--shadow-medium);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(79, 172, 254, 0.4); }
    100% { transform: scale(1); }
}

.pg-scope .progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-subtle);
    border-radius: 4px;
    overflow: hidden;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.pg-scope .progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

.pg-scope .info-panel {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.03) 0%, rgba(79, 172, 254, 0.03) 100%);
    border-left: 4px solid var(--accent-primary);
    border-radius: 0 16px 16px 0;
    padding: 1.5rem;
    margin: 1.5rem 0;
    backdrop-filter: blur(10px);
}

.pg-scope .info-panel h4 {
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.pg-scope .demo-playground {
    background: var(--bg-container);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow-medium);
    margin: 3rem 0;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

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

.pg-scope .playground-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-weight: 700;
}

.pg-scope .context-chunks {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 350px;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--bg-subtle);
    border-radius: 16px;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
}

.pg-scope .context-chunks::-webkit-scrollbar {
    width: 6px;
}

.pg-scope .context-chunks::-webkit-scrollbar-track {
    background: var(--bg-subtle);
    border-radius: 3px;
}

.pg-scope .context-chunks::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

.pg-scope .chunk-item {
    background: var(--bg-container);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.pg-scope .chunk-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.pg-scope .chunk-item.highlighted {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.02) 0%, rgba(220, 252, 231, 0.02) 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
}

.pg-scope .chunk-relevance {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gradient-tertiary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-light);
}

.pg-scope .loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(124, 92, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
}

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

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

.pg-scope .stat-card {
    background: var(--bg-container);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pg-scope .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

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

.pg-scope .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.pg-scope .stat-label {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

/* Fixed action buttons */
.pg-scope .fixed-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1000;
}

.pg-scope .fixed-actions .btn {
    box-shadow: var(--shadow-medium);
    min-width: 120px;
    justify-content: center;
}

/* Educational section */
.pg-scope .educational-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

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

    .pg-scope .playground-header {
        padding: 2rem 1rem;
    }

    .pg-scope .playground-header h1 {
        font-size: 2rem;
    }

    .pg-scope .playground-header p {
        font-size: 1rem;
    }

    .pg-scope .demo-playground {
        padding: 1.5rem;
    }

    .pg-scope .controls {
        flex-direction: column;
    }

    .pg-scope .btn {
        justify-content: center;
        width: 100%;
    }

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

    .pg-scope .fixed-actions {
        position: static;
        flex-direction: row;
        justify-content: center;
        margin: 2rem 0;
    }

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

/* Dark theme adjustments */
[data-theme="dark"] .pg-scope .document-chunk {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.15) 0%, rgba(91, 63, 217, 0.15) 100%);
    border-color: rgba(124, 92, 255, 0.3);
}

[data-theme="dark"] .pg-scope .response-box {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.08) 0%, rgba(0, 242, 254, 0.08) 100%);
    border-color: rgba(79, 172, 254, 0.3);
}

[data-theme="dark"] .pg-scope .vector-db {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(253, 230, 138, 0.08) 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

/* Animation classes */
.pg-scope .fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.pg-scope .slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Tooltip styles */
.pg-scope .tooltip {
    position: relative;
    cursor: help;
}

.pg-scope .tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--bg-container);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-medium);
}

.pg-scope .tooltip:hover::after {
    opacity: 1;
}

/* Success/Error states */
.pg-scope .success-message {
    background: rgb(204, 255, 0);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: rgb(91, 112, 122);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin: 1rem 0;
    text-align: center;
    font-weight: 500;
}

.pg-scope .error-message {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(254, 226, 226, 0.1) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin: 1rem 0;
    text-align: center;
    font-weight: 500;
}

/* Particle animations */
@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}