/* ===================================
   Card Component Styles
   Standardized cards for all modules
   =================================== */

/* Basic Card */
.card {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
}

/* Module Card - Standardized for BusinessMetrics, Dataloader, API Keys */
.module-card {
    position: relative;
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.module-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.module-card-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.module-card-icon-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(102, 126, 234, 0.15);
    border-radius: 12px;
}

.module-card-icon {
    font-size: 28px;
    color: #667eea;
}

.module-card-info {
    flex: 1;
    min-width: 0;
}

.module-card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.module-card-subtitle {
    display: block;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

/* Action Buttons Container - Multiple buttons */
.module-card-actions {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.module-card:hover .module-card-actions {
    opacity: 1;
}

/* Generic Action Button */
.module-card-action-btn {
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
}

.module-card-action-btn:hover {
    transform: scale(1.05);
}

/* Snapshot Button - Blue/Camera theme */
.module-card-snapshot-btn {
    background: #17a2b8;
}

.module-card-snapshot-btn:hover {
    background: #138496;
}

/* Delete Button specific styling */
.module-card-delete-btn {
    background: #dc3545;
}

.module-card-delete-btn:hover {
    background: #c82333;
}

.module-card:hover .card-actions {
    opacity: 1 !important;
}

.module-card .material-symbols-outlined {
    font-size: 20px;
}

/* Selectable Card State */
.module-card.selected {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.module-card.selected .module-card-icon-wrapper {
    background: rgba(40, 167, 69, 0.2);
}

.module-card.selected .module-card-icon {
    color: #28a745;
}

/* Loading Card State */
.module-card-loading {
    pointer-events: none;
    opacity: 0.7;
}

.module-card-loading .module-card-icon-wrapper {
    background: rgba(102, 126, 234, 0.25);
}

.module-card-loading .module-card-actions button {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards Grid Layout */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

/* Table Selection Cards - For Snapshot Modal */
.table-card {
    background: rgba(40, 40, 40, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-card:hover {
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(102, 126, 234, 0.1);
}

.table-card-selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
}

.table-card-selected:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.25);
}

.table-card .material-symbols-outlined {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s ease;
}

.table-card-selected .material-symbols-outlined {
    color: #667eea;
}

/* Deleted Card - Same as module-card but with red border */
.module-card.deleted-card {
    border-color: var(--color-danger);
    background: rgba(220, 53, 69, 0.05);
}

.module-card.deleted-card:hover {
    border-color: var(--color-danger);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.module-card.deleted-card .module-card-icon-wrapper {
    background: rgba(220, 53, 69, 0.15);
}

.module-card.deleted-card .module-card-icon {
    color: var(--color-danger);
}

/* Responsive */
@media (max-width: 768px) {
    .card {
        padding: 16px;
    }
    
    .module-card {
        padding: 16px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}
