/* =================================================================
   INTEGRAZIONI TABELLA - STYLES
   ================================================================= */
   
/* Table Container */
.integrations-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background: white;
}

.integrations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

/* Table Header - ROSSO */
.integrations-table thead {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.integrations-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.integrations-table thead th.details-col {
    text-align: center;
    width: 80px;
}

/* Table Body - ASSICURA ALLINEAMENTO VERTICALE */
.integrations-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    height: auto;
}

.integrations-table tbody tr:hover {
    background: #f8fafc;
    transform: scale(1.005);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.integrations-table tbody tr:last-child {
    border-bottom: none;
}

.integrations-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    height: auto;
}

.integrations-table tbody td:first-child {
    vertical-align: middle;
}

/* Integration Name Column - ALLINEATA VERTICALMENTE */
.integration-name {
    font-weight: 500;
    color: #1e293b;
}

.integration-logo {
    width: 28px;
    height: 28px;
    vertical-align: middle;
    display: inline-block;
    margin-right: 0.75rem;
}

.integration-name span:not(.category-badge) {
    font-size: 0.85rem;
    vertical-align: middle;
}

/* Category Column */
.category-col {
    text-align: center;
    width: 100px;
    vertical-align: middle;
}

/* Category badges con font più piccolo */
.category-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
    vertical-align: middle;
}

/* Action Column - FONT PIÙ PICCOLO per la terza colonna */
.action-col {
    text-align: center;
    width: 120px;
    vertical-align: middle;
}

.status-free,
.status-paid,
.status-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    vertical-align: middle;
}

.status-free {
    background: #d1fae5;
    color: #065f46;
    font-size: 0.8rem; /* FONT PIÙ PICCOLO */
    border: 1px solid #10b981;
}

.status-paid {
    background: #fef3c7;
    color: #92400e;
    font-size: 0.8rem; /* FONT PIÙ PICCOLO */
    border: 1px solid #f59e0b;
}

.status-badge {
    background: #e0e7ff;
    color: #3730a3;
    font-size: 0.75rem; /* FONT PIÙ PICCOLO */
    border: 1px solid #6366f1;
}

/* Usage Column */
.usage-col {
    width: 35%;
    max-width: 350px;
    vertical-align: middle;
}

.usage-text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #475569;
}

/* Details Column */
.details-col {
    text-align: center;
    width: 80px;
    vertical-align: middle;
}

.btn-details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #6366f1;
    text-decoration: none;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.btn-details:hover {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
    transform: scale(1.1);
}

.btn-details svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.btn-details:hover svg {
    transform: translateX(2px) translateY(-2px);
}

/* Upcoming Table Styling */
.integrations-table.upcoming tbody tr {
    opacity: 0.85;
}

.integrations-table.upcoming tbody tr:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .integrations-table-wrapper {
        border-radius: 8px;
    }
    
    .integrations-table {
        font-size: 0.85rem;
    }
    
    .integrations-table thead th {
        padding: 0.6rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .integrations-table tbody td {
        padding: 0.6rem 0.5rem;
        vertical-align: middle;
    }
    
    .integration-name {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        min-height: auto;
        height: auto;
    }
    
    .integration-logo {
        width: 24px;
        height: 24px;
    }
    
    .integration-name span:not(.category-badge) {
        font-size: 0.85rem;
    }
    
    .category-col {
        width: 90px;
    }
    
    .category-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.5rem;
    }
    
    .status-free,
    .status-paid,
    .status-badge {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .usage-text {
        font-size: 0.75rem;
        line-height: 1.3;
        min-height: auto;
        align-items: flex-start;
    }
    
    .btn-details {
        width: 32px;
        height: 32px;
    }
    
    .btn-details svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .integrations-table thead {
        display: none;
    }
    
    .integrations-table tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        padding: 0.75rem;
        height: auto;
    }
    
    .integrations-table tbody td {
        display: block;
        padding: 0.4rem 0;
        border: none;
        height: auto;
        vertical-align: middle;
    }
    
    .integration-name {
        flex-direction: row;
        align-items: center;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid #e2e8f0;
        min-height: auto;
        height: auto;
    }
    
    .category-col,
    .action-col,
    .details-col,
    .usage-col {
        width: 100%;
        text-align: left;
    }
    
    .category-col::before {
        content: "Categoria: ";
        font-weight: 700;
        color: #64748b;
        margin-right: 0.5rem;
        font-size: 0.8rem;
    }
    
    .action-col::before {
        content: "Stato: ";
        font-weight: 700;
        color: #64748b;
        margin-right: 0.5rem;
        font-size: 0.8rem;
    }
    
    .integrations-table.upcoming .action-col::before {
        content: "Disponibilità: ";
    }
    
    .usage-col::before {
        content: "Utilizzo: ";
        font-weight: 700;
        color: #64748b;
        margin-right: 0.5rem;
        display: block;
        margin-bottom: 0.2rem;
        font-size: 0.8rem;
    }
    
    .details-col::before {
        content: "Info: ";
        font-weight: 700;
        color: #64748b;
        margin-right: 0.5rem;
        font-size: 0.8rem;
    }
    
    .status-free,
    .status-paid,
    .status-badge {
        display: inline-block;
        margin-top: 0.2rem;
        font-size: 0.75rem;
    }
    
    .usage-text {
        min-height: auto;
    }
}

/* Filter Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.integrations-table tbody tr {
    animation: fadeIn 0.3s ease forwards;
}

/* Category Colors */
.category-badge[data-category="messaging"],
.category-badge:contains("Messaging") {
    background: #dbeafe;
    color: #1e40af;
}

.category-badge[data-category="automation"],
.category-badge:contains("Automation") {
    background: #fce7f3;
    color: #9f1239;
}

.category-badge[data-category="crm"],
.category-badge:contains("CRM") {
    background: #d1fae5;
    color: #065f46;
}

.category-badge[data-category="productivity"],
.category-badge:contains("Productivity") {
    background: #fef3c7;
    color: #92400e;
}

.category-badge[data-category="calendar"],
.category-badge:contains("Calendar") {
    background: #e0e7ff;
    color: #3730a3;
}

.category-badge[data-category="ecommerce"],
.category-badge:contains("E-commerce") {
    background: #ede9fe;
    color: #5b21b6;
}
