/* ========================================
   RIG MINING STYLES
   ======================================== */

/* Header Section */
.rig-header {
    text-align: center;
    margin-bottom: 2rem;
}

.rig-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #f1f5f9;
}

.rig-description {
    font-size: 1rem;
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto;
}

/* Stats Bar */
.rig-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    border: 1px solid #334155;
}

.rig-stats-bar .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.rig-stats-bar .stat-label {
    font-size: 0.9rem;
    color: #94a3b8;
}

.rig-stats-bar .stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #22d3ee;
}

/* Actions Bar */
.rig-actions-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

/* Rigs List */
.rigs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Rig Card */
.rig-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.rig-card:hover {
    transform: translateY(-2px);
    border-color: #22d3ee;
    box-shadow: 0 8px 20px rgba(34, 211, 238, 0.1);
}

.rig-card.running {
    border-color: #10b981;
    background: linear-gradient(135deg, #064e3b 0%, #0f172a 100%);
}

.rig-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.rig-card h3 {
    font-size: 1.2rem;
    color: #f1f5f9;
    margin: 0;
}

.status-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: #334155;
    color: #cbd5e1;
}

.status-badge.running {
    background: #10b981;
    color: white;
}

/* Rig Stats */
.rig-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.rig-stats .stat {
    display: flex;
    flex-direction: column;
}

.rig-stats .stat-label {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.rig-stats .stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: #f1f5f9;
}

.rig-stats .stat-value.positive {
    color: #10b981;
}

.rig-stats .stat-value.negative {
    color: #ef4444;
}

/* Rig Components */
.rig-components {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #0f172a;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #94a3b8;
}

/* Rig Errors */
.rig-errors {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #fca5a5;
}

/* Rig Actions */
.rig-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rig-actions button {
    flex: 1;
    min-width: 100px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px dashed #334155;
    border-radius: 12px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #f1f5f9;
}

.empty-state p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

/* ========================================
   RIG BUILDER MODAL
   ======================================== */

.rig-builder-modal {
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.rig-builder {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Builder Header */
.rig-builder-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
}

.rig-name-input {
    font-size: 1.3rem;
    font-weight: 700;
    padding: 0.5rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f1f5f9;
    width: 100%;
}

.rig-stats-summary {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 1rem;
    color: #94a3b8;
}

.rig-stats-summary span {
    padding: 0.5rem 1rem;
    background: #0f172a;
    border-radius: 8px;
}

/* Validation */
.validation-errors {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 8px;
    padding: 1rem;
    color: #fca5a5;
}

.validation-errors div {
    margin-bottom: 0.5rem;
}

.validation-errors div:last-child {
    margin-bottom: 0;
}

.validation-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #10b981;
    border-radius: 8px;
    padding: 1rem;
    color: #6ee7b7;
    text-align: center;
    font-weight: 600;
}

/* Components Grid */
.components-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.component-section {
    background: #0f172a;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #334155;
}

.component-section h3 {
    font-size: 1.2rem;
    color: #f1f5f9;
    margin-bottom: 1rem;
}

.components-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

/* Component Card */
.component-card {
    position: relative;
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.component-card:hover {
    border-color: #22d3ee;
    transform: translateY(-2px);
}

.component-card.selected {
    border-color: #10b981;
    background: linear-gradient(135deg, #064e3b 0%, #1e293b 100%);
}

.component-name {
    font-size: 1rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.component-stats {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.component-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #22d3ee;
}

.selected-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #10b981;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Crypto Selection */
.crypto-selection {
    background: #0f172a;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #334155;
}

.crypto-selection h4 {
    font-size: 1.1rem;
    color: #f1f5f9;
    margin-bottom: 1rem;
}

.crypto-selection select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f1f5f9;
    cursor: pointer;
}

.crypto-selection select:focus {
    outline: none;
    border-color: #22d3ee;
}

/* Builder Footer */
.rig-builder-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    border: 1px solid #334155;
    margin-top: 1rem;
}

.total-cost {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.2rem;
}

.cost-value {
    font-weight: 700;
    font-size: 1.5rem;
    color: #10b981;
}

.cost-value.insufficient {
    color: #ef4444;
}

.insufficient-funds {
    font-size: 0.9rem;
    color: #fca5a5;
    font-weight: 400;
}

.builder-actions {
    display: flex;
    gap: 1rem;
}

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

@media (max-width: 768px) {
    .rigs-list {
        grid-template-columns: 1fr;
    }
    
    .components-list {
        grid-template-columns: 1fr;
    }
    
    .rig-stats-bar {
        grid-template-columns: 1fr 1fr;
    }
    
    .rig-builder-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .builder-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .builder-actions button {
        width: 100%;
    }
}

/* ========================================
   NOUVELLES FONCTIONNALITÉS V1.7.0
   ======================================== */

/* Stats étendues */
.rig-stats-extended {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.rig-stats-extended .stat {
    background: #1e293b;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
}

.rig-stats-extended .stat-label {
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
    margin-bottom: 0.25rem;
}

.rig-stats-extended .stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: #f1f5f9;
}

.rig-stats-extended .stat-value.danger {
    color: #ef4444;
}

.rig-stats-extended .stat-value.warning {
    color: #f59e0b;
}

/* Badges de statut */
.rig-status-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 2px solid;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.status-badge.running {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.status-badge.pool {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: #8b5cf6;
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.status-badge.oc {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
    border-color: #eab308;
    color: white;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.3);
}

/* Barre d'efficacité */
.efficiency-bar {
    background: #1e293b;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.efficiency-bar span {
    display: block;
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 8px;
    background: #334155;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease, background 0.3s ease;
}

/* Suggestions d'optimisation */
.optimization-suggestions {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.optimization-suggestions strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #60a5fa;
}

.suggestion {
    font-size: 0.85rem;
    color: #cbd5e1;
    padding: 0.25rem 0;
}

/* Actions étendues */
.rig-actions-extended {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    white-space: nowrap;
}

.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-secondary.btn-sm {
    background: #334155 !important;
    border-color: #475569 !important;
}

.btn-secondary.btn-sm:hover {
    background: #475569 !important;
    border-color: #64748b !important;
}

.btn-primary.btn-sm {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: none !important;
}

.btn-primary.btn-sm:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
}

.btn-danger.btn-sm {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border: none !important;
}

.btn-danger.btn-sm:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
}

/* Rig dégradé */
.rig-card.degraded {
    border-color: #f59e0b;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .rig-stats-extended {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rig-actions-extended {
        grid-template-columns: 1fr 1fr;
    }
}

