/* Projects Page Styles */

.projects-list {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-faint);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 400px;
}

.project-card:hover {
    border-color: var(--border-subtle);
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.project-card-title {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 4px;
}

.project-card-command {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-bright);
    letter-spacing: 0.05em;
}

.project-card-toggle {
    flex-shrink: 0;
}

.project-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.project-info-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 10px;
}

.project-info-label {
    color: var(--text-muted);
    min-width: 70px;
}

.project-info-value {
    color: var(--text-secondary);
    flex: 1;
}

.project-card-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(10, 22, 40, 0.3);
    border-radius: var(--radius-sm);
}

.project-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.project-status-indicator.indexed {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.project-status-indicator.indexing {
    background: var(--accent-amber);
    box-shadow: 0 0 8px var(--accent-amber);
    animation: pulse 1.5s ease-in-out infinite;
}

.project-status-indicator.not-indexed {
    background: var(--text-disabled);
}

.project-status-indicator.error {
    background: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red);
}

.project-status-text {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
    flex: 1;
}

/* Spinner for indexing */
.project-status-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--accent-amber);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* Show spinner when card has indexing class */
.project-card.indexing .project-card-status {
    position: relative;
}

.project-card.indexing .project-status-indicator {
    display: none;
}

.project-card.indexing .project-card-status::before {
    content: '';
    width: 15px;
    height: 15px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--accent-amber);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.project-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.project-card-actions button {
    flex: 1;
    min-width: 145px;
    padding: 6px 12px;
    white-space: nowrap;
}

.projects-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-faint);
    display: flex;
    gap: 8px;
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Projects Cache Cards */
.projects-cache-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-faint);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: var(--transition);
}

.projects-cache-card:hover {
    border-color: var(--border-subtle);
}

.projects-cache-card-header {
    margin-bottom: 12px;
}

.projects-cache-card-title {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.projects-cache-card-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.projects-cache-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.projects-cache-stat-label {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.projects-cache-stat-value {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.projects-cache-card-actions {
    display: flex;
    gap: 6px;
}
