/* CTF Sidecar Styles */

/* Sidecar Panel */
.ctf-sidecar {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    height: 100vh;
    background: linear-gradient(180deg, #0d1117 0%, #161b22 100%);
    border-left: 1px solid rgba(0, 255, 136, 0.2);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ctf-sidecar.open {
    transform: translateX(0);
}

.ctf-sidecar.closed {
    transform: translateX(100%);
}

/* Sidecar Header */
.ctf-sidecar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 255, 136, 0.15);
    background: rgba(0, 0, 0, 0.3);
}

/* Sidecar Content */
.ctf-sidecar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Loading State */
.ctf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
}

/* Sections */
.ctf-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.ctf-section-activity {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

/* Progress Bar */
.ctf-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.ctf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #06ffa5 50%, #00d4ff 100%);
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

/* Badges Grid */
.ctf-badges-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.ctf-badge-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ctf-badge-item:hover {
    background: rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.3);
    transform: scale(1.05);
}

.ctf-badge-item.rarity-legendary {
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}

.ctf-badge-item.rarity-epic {
    border-color: rgba(138, 43, 226, 0.5);
    box-shadow: 0 0 12px rgba(138, 43, 226, 0.2);
}

.ctf-badge-item.rarity-rare {
    border-color: rgba(0, 191, 255, 0.5);
}

.ctf-badge-empty {
    grid-column: span 4;
    text-align: center;
    padding: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Active Challenge Card */
.ctf-challenge-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: all 0.2s;
}

.ctf-challenge-card:hover {
    background: rgba(0, 255, 136, 0.05);
    border-color: rgba(0, 255, 136, 0.2);
}

.ctf-challenge-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 0.25rem;
}

.ctf-challenge-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.ctf-challenge-points {
    color: #10b981;
    font-weight: 600;
}

.ctf-difficulty-badge {
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ctf-difficulty-easy { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.ctf-difficulty-medium { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.ctf-difficulty-hard { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.ctf-difficulty-expert { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }

/* Empty State */
.ctf-empty-state {
    text-align: center;
    padding: 1rem;
    color: #6b7280;
}

/* Activity Stream */
.ctf-activity-stream {
    flex: 1;
    overflow-y: auto;
    max-height: 250px;
}

.ctf-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    animation: slideIn 0.3s ease-out;
}

.ctf-activity-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

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

.ctf-activity-icon {
    width: 28px;
    height: 28px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.ctf-activity-icon.agent { background: rgba(139, 92, 246, 0.2); }
.ctf-activity-icon.business { background: rgba(6, 182, 212, 0.2); }
.ctf-activity-icon.ctf { background: rgba(16, 185, 129, 0.2); }

.ctf-activity-content {
    flex: 1;
    min-width: 0;
}

.ctf-activity-summary {
    font-size: 0.8125rem;
    color: #d1d5db;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ctf-activity-time {
    font-size: 0.6875rem;
    color: #6b7280;
}

/* Sidecar Footer */
.ctf-sidecar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(0, 255, 136, 0.15);
    background: rgba(0, 0, 0, 0.3);
}

.ctf-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #10b981 0%, #06ffa5 100%);
    color: #0d1117;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s;
}

.ctf-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Overlay */
.ctf-sidecar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.ctf-sidecar-overlay.visible {
    opacity: 1;
}

/* Responsive */
@media (max-width: 640px) {
    .ctf-sidecar {
        width: 100%;
    }
}

/* Scrollbar */
.ctf-sidecar-content::-webkit-scrollbar,
.ctf-activity-stream::-webkit-scrollbar {
    width: 6px;
}

.ctf-sidecar-content::-webkit-scrollbar-track,
.ctf-activity-stream::-webkit-scrollbar-track {
    background: transparent;
}

.ctf-sidecar-content::-webkit-scrollbar-thumb,
.ctf-activity-stream::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.ctf-sidecar-content::-webkit-scrollbar-thumb:hover,
.ctf-activity-stream::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
