/**
 * Estilos del Módulo de Hardware
 * Diseño moderno y minimalista estilo OpenAI
 */

/* ============================================== 
   CONTENEDOR PRINCIPAL
   ============================================== */

.hardware-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================== 
   INTRODUCCIÓN
   ============================================== */

.hardware-intro {
    background: linear-gradient(135deg, #f6f8fc 0%, #f0f4ff 100%);
    border-radius: 16px;
    padding: 24px 28px;
    border: 1px solid #e5e7eb;
}

.hardware-intro-text {
    margin: 0;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
}

/* ============================================== 
   ESTADÍSTICAS
   ============================================== */

.hardware-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.hardware-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.hardware-stat-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-icon.tpv {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.pda {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon.total {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================== 
   SECCIONES
   ============================================== */

.hardware-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hardware-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.hardware-section-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.hardware-section-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* ============================================== 
   GRID DE EQUIPOS
   ============================================== */

.hardware-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* ============================================== 
   TARJETAS DE EQUIPO
   ============================================== */

.hardware-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.hardware-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

/* Header de la tarjeta */
.hardware-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.hardware-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.hardware-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hardware-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hardware-status-badge.online {
    background: #d1fae5;
    color: #065f46;
}

.hardware-status-badge.offline {
    background: #fee2e2;
    color: #991b1b;
}

.hardware-status-badge.busy {
    background: #fef3c7;
    color: #92400e;
}

/* Contenido de la tarjeta */
.hardware-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hardware-title-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.hardware-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hardware-tipo-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hardware-tipo-badge.tpv {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.hardware-tipo-badge.pda {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.hardware-tipo-badge.otro {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

/* Grid de información */
.hardware-info-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hardware-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #6b7280;
}

.hardware-info-item svg {
    flex-shrink: 0;
    color: #9ca3af;
}

.hardware-info-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hardware-info-item .hardware-id {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #4b5563;
}

/* Features del equipo */
.hardware-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.hardware-feature {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    color: #9ca3af;
    transition: all 0.2s ease;
}

.hardware-feature.active {
    background: #ecfdf5;
    border-color: #86efac;
    color: #065f46;
}

.hardware-feature svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Footer de la tarjeta */
.hardware-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.hardware-btn-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.hardware-btn-details:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}

.hardware-btn-details svg {
    width: 16px;
    height: 16px;
}

/* ============================================== 
   ESTADOS DE CARGA Y ERROR
   ============================================== */

.hardware-loading,
.hardware-error,
.hardware-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.hardware-loading {
    gap: 20px;
}

.hardware-error,
.hardware-empty {
    gap: 16px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f4f6;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.hardware-loading p {
    margin: 0;
    color: #6b7280;
    font-size: 15px;
}

.hardware-error svg,
.hardware-empty svg {
    color: #d1d5db;
}

.hardware-error h3,
.hardware-empty h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.hardware-error p,
.hardware-empty p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    max-width: 400px;
}

.btn-retry {
    margin-top: 8px;
    padding: 10px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-retry:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

@media (max-width: 768px) {
    .hardware-container {
        padding: 16px;
        gap: 24px;
    }

    .hardware-stats {
        grid-template-columns: 1fr;
    }

    .hardware-grid {
        grid-template-columns: 1fr;
    }

    .hardware-intro {
        padding: 20px;
    }

    .hardware-intro-text {
        font-size: 14px;
    }

    .hardware-card {
        padding: 20px;
    }

    .hardware-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .hardware-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .hardware-card-footer {
        flex-direction: column;
    }

    .hardware-btn-details {
        width: 100%;
    }
}

/* ============================================== 
   TEMA OSCURO (Opcional)
   ============================================== */

@media (prefers-color-scheme: dark) {
    .hardware-container {
        color: #e5e7eb;
    }

    .hardware-intro {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        border-color: #374151;
    }

    .hardware-intro-text {
        color: #9ca3af;
    }

    .hardware-stat-card {
        background: #1f2937;
        border-color: #374151;
    }

    .hardware-stat-card:hover {
        border-color: #4b5563;
    }

    .stat-value {
        color: #f9fafb;
    }

    .hardware-section-header {
        border-color: #374151;
    }

    .hardware-section-header h2 {
        color: #f9fafb;
    }

    .hardware-section-badge {
        background: #374151;
        color: #d1d5db;
    }

    .hardware-card {
        background: #1f2937;
        border-color: #374151;
    }

    .hardware-card:hover {
        border-color: #4b5563;
    }

    .hardware-title {
        color: #f9fafb;
    }

    .hardware-info-item {
        color: #9ca3af;
    }

    .hardware-feature {
        background: #111827;
        border-color: #374151;
        color: #6b7280;
    }

    .hardware-card-footer {
        border-color: #374151;
    }

    .hardware-btn-details {
        background: #111827;
        border-color: #374151;
        color: #d1d5db;
    }

    .hardware-btn-details:hover {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .hardware-empty svg,
    .hardware-error svg {
        color: #4b5563;
    }

    .hardware-empty h3,
    .hardware-error h3 {
        color: #f9fafb;
    }

    .hardware-empty p,
    .hardware-error p {
        color: #9ca3af;
    }
}

