/**
 * D-One Platform - Card Component System
 * 
 * Sistema unificato per card service/agent/kb/tools
 * Versione: 1.0
 * Data: 2025-10-19
 */

/* BASE CARD STRUCTURE */
.content-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 350px;
}

.content-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-gradient, linear-gradient(90deg, var(--primary) 0%, var(--primary-2) 100%));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.content-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-lg);
}

.content-card:hover::before {
    transform: scaleX(1);
}

/* CARD ICON */
.card-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--icon-color, var(--text-primary));
    flex-shrink: 0;
}

/* CARD HEADER TOP - Icon, Category, Agent-Status sulla stessa riga */
.card-header-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap;
    width: 100%;
}

.card-header-top .card-icon {
    margin-bottom: 0;
    width: 60px;
    height: 60px;
    font-size: 2rem;
    flex-shrink: 0;
}

.card-header-top .card-category {
    margin-bottom: 0;
    align-self: center;
    flex-shrink: 0;
}

.card-header-top .agent-status {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: center;
    align-self: center;
}

.card-icon img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
}

/* CARD CONTENT */
.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-category {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0;
    width: auto;           /* Force inline sizing */
    max-width: none;       /* Remove any width constraints */
    white-space: nowrap;
    flex-shrink: 0;
}

/* AGENT STATUS */
.agent-status {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

/* THEME VARIANTS */
.content-card[data-theme="services"]::before {
    background: linear-gradient(90deg, #6c5ce7 0%, #a29bfe 50%, #fd79a8 100%);
}

.content-card[data-theme="agents"]::before {
    background: linear-gradient(90deg, #9458cf 0%, #4652c2 50%, #6747b4 100%);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .content-card {
        padding: 1.5rem;
        min-height: unset;
    }
    .card-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    .card-header-top {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    .card-header-top .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    .card-header-top .agent-status {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .content-card {
        padding: 1rem;
    }

    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.6rem;
    }

    .card-header-top .card-icon {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }

    .content-card h3 {
        font-size: 1.1rem;
    }

    .content-card p {
        font-size: 0.85rem;
    }
}

/* ANIMATIONS */
.content-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.content-card:nth-child(2) { animation-delay: 0.1s; }
.content-card:nth-child(3) { animation-delay: 0.2s; }
.content-card:nth-child(4) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
