/* ==================================================
   AGENT CARDS - Glass Morphism Styling
   ================================================== */

/* Base Agent Card */
.agent-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--color-primary) 50%, 
        transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.agent-card:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: 0 0 20px rgba(20, 241, 149, 0.3), 0 8px 32px rgba(31, 38, 135, 0.5);
}

.agent-card:hover::before {
    opacity: 1;
}

/* Featured Agent Card */
.agent-card.featured {
    background: linear-gradient(135deg, rgba(20, 241, 149, 0.05) 0%, rgba(153, 69, 255, 0.05) 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.agent-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-lg);
    padding: 2px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary), var(--color-tertiary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: gradient-border-rotate 4s linear infinite;
}

.agent-card.featured:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl), var(--shadow-glow-primary), var(--shadow-glow-secondary);
}

/* Agent Card Preview Image */
.agent-card-preview {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-md);
    position: relative;
    background: var(--bg-secondary);
}

.agent-card-preview img,
.agent-card-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.agent-card:hover .agent-card-preview img,
.agent-card:hover .agent-card-preview video {
    transform: scale(1.05);
}

/* Video Play Button Overlay */
.agent-card-preview-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(20, 241, 149, 0.9);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    font-size: var(--text-2xl);
    transition: all var(--transition-base);
    pointer-events: none;
}

.agent-card:hover .agent-card-preview-play-btn {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: var(--shadow-glow-primary);
}

/* Creator Info */
.agent-card-creator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.agent-card-creator-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
}

.agent-card-creator-name {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.agent-card-creator-verified {
    color: var(--color-primary);
    font-size: var(--text-sm);
}

/* Agent Card Title & Description */
.agent-card-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.agent-card-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tags */
.agent-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.agent-card-tag {
    padding: 4px 12px;
    background: rgba(153, 69, 255, 0.15);
    border: 1px solid rgba(153, 69, 255, 0.3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--color-secondary);
    transition: all var(--transition-fast);
}

.agent-card-tag:hover {
    background: rgba(153, 69, 255, 0.25);
    border-color: var(--color-secondary);
}

.agent-card-tag.category {
    background: rgba(20, 241, 149, 0.15);
    border-color: rgba(20, 241, 149, 0.3);
    color: var(--color-primary);
}

/* Stats Grid */
.agent-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
}

.agent-card-stat {
    text-align: center;
}

.agent-card-stat-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    display: block;
}

.agent-card-stat-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Credit Cost Badge */
.credit-cost-badge,
.credit-cost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(20, 241, 149, 0.1);
    border: 1px solid rgba(20, 241, 149, 0.3);
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-primary);
    box-shadow: 0 0 10px rgba(20, 241, 149, 0.2);
}

/* Execute Button */
.btn-execute-agent {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-tertiary) 100%);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-inverse);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 0 20px rgba(20, 241, 149, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.btn-execute-agent:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-primary);
}

.btn-execute-agent:active {
    transform: translateY(0);
}

/* Compact Agent Card (for lists/sidebars) */
.agent-card-compact {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    cursor: pointer;
}

.agent-card-compact:hover {
    border-color: var(--border-primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.agent-card-compact-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.agent-card-compact-info {
    flex: 1;
    min-width: 0;
}

.agent-card-compact-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-card-compact-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* Rating Stars */
.rating-stars {
    display: inline-flex;
    gap: 2px;
    color: #FFB84D;
}

/* Skeleton Loading State */
.agent-card-skeleton {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive Agent Cards */
@media (max-width: 768px) {
    .agent-card {
        padding: var(--space-md);
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .agent-card-preview {
        height: 160px;
    }
    
    .agent-card-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
        padding: var(--space-sm);
    }
    
    .agent-card-compact {
        flex-direction: column;
    }
    
    .agent-card-compact-thumbnail {
        width: 100%;
        height: 120px;
    }
    
    /* Ensure MudGrid items are visible on mobile */
    .mud-grid-item {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .agent-card {
        margin-bottom: var(--space-md);
    }
    
    .agent-card-title {
        font-size: var(--text-lg);
    }
    
    .btn-execute-agent {
        padding: 10px 20px;
        font-size: var(--text-sm);
    }
}
