.trading-view-operations-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.operations-view-header {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e0e0e0;
}

.operations-title {
    margin: 0 0 20px 0;
    color: #1d2327;
    font-size: 1.8em;
    font-weight: 700;
    text-align: center;
}

.operations-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #3c434a;
    font-size: 0.9em;
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #ffffff;
    font-size: 14px;
    transition: all 0.2s ease;
}

.filter-select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
    outline: none;
}

/* Estadísticas */
.operations-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-value {
    font-size: 2em;
    font-weight: 800;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    font-weight: 500;
}

/* Grid de operaciones */
.operations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.operation-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f1;
    transition: all 0.3s ease;
    overflow: hidden;
}

.operation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.operation-card.open {
    border-left: 4px solid #0073aa;
}

.operation-card.closed {
    border-left: 4px solid #646970;
}

.operation-card.positive {
    border-top: 3px solid #43e97b;
}

.operation-card.negative {
    border-top: 3px solid #f5576c;
}

/* Header de la card */
.operation-header {
    padding: 20px 20px 15px;
    border-bottom: 1px solid #f0f0f1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.operation-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f0f0f1;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 700;
    color: #1d2327;
    font-size: 1em;
}

.user-portfolio {
    font-size: 0.8em;
    color: #646970;
    margin-top: 2px;
}

.operation-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-buy {
    background: #d1f7e4;
    color: #0a8754;
}

.badge-sell {
    background: #fde7e9;
    color: #d63638;
}

.badge-open {
    background: #e7f1ff;
    color: #0073aa;
}

.badge-closed {
    background: #f6f7f7;
    color: #646970;
}

/* Body de la card */
.operation-body {
    padding: 20px;
}

.instrument-info {
    text-align: center;
    margin-bottom: 20px;
}

.instrument-name {
    font-size: 1.3em;
    font-weight: 700;
    color: #1d2327;
    margin-bottom: 5px;
}

.instrument-symbol {
    font-size: 0.9em;
    color: #646970;
    font-weight: 500;
}

.operation-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.detail-label {
    font-size: 0.8em;
    color: #646970;
    margin-bottom: 4px;
    font-weight: 500;
}

.detail-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #1d2327;
}

.detail-value.positive {
    color: #43e97b;
}

.detail-value.negative {
    color: #f5576c;
}

/* Precios section */
.prices-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.price-row:last-child {
    margin-bottom: 0;
}

.price-label {
    font-size: 0.85em;
    color: #646970;
}

.price-value {
    font-weight: 600;
    color: #1d2327;
}

.current-price {
    font-size: 1.1em;
    font-weight: 700;
    color: #0073aa;
}

/* Footer de la card */
.operation-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #f0f0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.operation-date {
    font-size: 0.8em;
    color: #646970;
}

.operation-duration {
    font-size: 0.8em;
    color: #646970;
    font-weight: 500;
}

/* Loading states */
.loading-cards {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f1;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 30px;
}

.load-more-btn {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3);
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .operations-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 768px) {
    .trading-view-operations-container {
        padding: 15px;
    }
    
    .operations-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .operations-filters {
        grid-template-columns: 1fr;
    }
    
    .operations-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .operation-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .operation-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .operations-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.5em;
    }
}


/* Estilos para el valor de posición */
.position-value {
    color: #0073aa;
    font-weight: 700;
}

/* Ajustar el grid de detalles para 4 columnas */
.operation-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

/* Mejorar la sección de precios */
.prices-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e9ecef;
}

.price-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.price-label {
    font-size: 0.85em;
    color: #646970;
    font-weight: 500;
}

.price-value {
    font-weight: 600;
    color: #1d2327;
}

.current-price {
    font-size: 1em;
    font-weight: 700;
    color: #0073aa;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .operation-details {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .operation-details {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .prices-section {
        padding: 12px;
    }
}