/**
 * SDScreener - Reusable Components
 * Shared UI components used across all tabs
 */

/* ============================================================================
   CARDS - Universal card component
   ============================================================================ */

.card-base {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card-base:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header-base {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid rgba(15, 182, 204, 0.1);
}

.card-flag {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
}

.card-details {
    flex: 1;
    min-width: 0; /* Permite que el texto se ajuste */
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: var(--wowate-grey);
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: #6c757d;
    margin: 0;
}

.card-body-base {
    margin: var(--spacing-md) 0;
}

.card-actions-base {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
}

@media (max-width: 576px) {
    .card-actions-base {
        flex-direction: column;
    }
    
    .card-actions-base .btn {
        width: 100%;
    }
}

/* ============================================================================
   BUTTONS - Unified button styles
   ============================================================================ */

.btn-base {
    padding: 0.6rem 1rem;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    text-decoration: none;
}

.btn-base:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn-base:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary-custom {
    background: var(--gradient-cyan);
    color: white;
    box-shadow: 0 2px 8px rgba(15, 182, 204, 0.3);
}

.btn-primary-custom:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(15, 182, 204, 0.4);
}

.btn-secondary-custom {
    background: var(--gradient-grey);
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.btn-secondary-custom:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.btn-danger-custom {
    background: var(--gradient-danger);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-danger-custom:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-success-custom {
    background: var(--gradient-green);
    color: var(--grey-dark);
    box-shadow: 0 2px 8px rgba(174, 255, 0, 0.3);
}

.btn-success-custom:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(174, 255, 0, 0.4);
}

/* ============================================================================
   BADGES - Status indicators
   ============================================================================ */

.badge-base {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.35rem 0.65rem;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.badge-success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.badge-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.badge-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.badge-info {
    background: rgba(15, 182, 204, 0.1);
    color: var(--wowate-cyan);
}

.badge-secondary {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

.loading-container {
    text-align: center;
    padding: 3rem 1rem;
}

.loading-container .spinner-border {
    width: 3rem;
    height: 3rem;
}

.loading-spinner-sm {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(15, 182, 204, 0.3);
    border-radius: 50%;
    border-top-color: var(--wowate-cyan);
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* ============================================================================
   EMPTY STATES
   ============================================================================ */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.empty-state h4 {
    color: var(--wowate-grey);
    margin-bottom: 0.5rem;
}

/* ============================================================================
   STATS CARDS
   ============================================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--wowate-cyan);
    margin: 0.5rem 0;
}

.stat-label {
    color: #6c757d;
    margin: 0;
    font-size: var(--font-size-sm);
}

/* ============================================================================
   RESPONSIVE UTILITIES
   ============================================================================ */

.flex-responsive {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

@media (max-width: 768px) {
    .flex-responsive {
        flex-direction: column;
    }
    
    .flex-responsive > * {
        width: 100%;
    }
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
